Skip to content

Commit 5f7881f

Browse files
committed
added some code to add created,updated dates should that get supported in CITATION.cff
1 parent 235cfc5 commit 5f7881f

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"codeRepository": "https://github.com/caltechlibrary/datatools",
77
"issueTracker": "https://github.com/caltechlibrary/datatools/issues",
88
"license": "https://data.caltech.edu/license",
9-
"version": "1.0.4",
9+
"version": "1.0.5-dev",
1010
"author": [
1111
{
1212
"@type": "Person",

codemeta/codemeta.go

+20-2
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,34 @@ doi: %s`, doi))...)
9393
src = append(src, []byte(fmt.Sprintf(`
9494
version: %s`, cm.Version))...)
9595
}
96+
now := time.Now()
97+
dt := now.Format("2006-01-02")
9698
if cm.Name != "" {
9799
src = append(src, []byte(fmt.Sprintf(`
98100
title: %s`, cm.Name))...)
99101
}
102+
/*
103+
// This is code to supported created, modified dates when/if
104+
// they get added to CITATION.cff
105+
if cm.Created != "" {
106+
src = append(src, []byte(fmt.Sprintf(`
107+
date-created: %s`, cm.Created))...)
108+
} else {
109+
src = append(src, []byte(fmt.Sprintf(`
110+
date-created: %s`, dt))...)
111+
}
112+
if cm.Updated != "" {
113+
src = append(src, []byte(fmt.Sprintf(`
114+
date-updated: %s`, cm.Updated))...)
115+
} else {
116+
src = append(src, []byte(fmt.Sprintf(`
117+
date-updated: %s`, cm.Updated))...)
118+
}
119+
*/
100120
if cm.Published != "" {
101121
src = append(src, []byte(fmt.Sprintf(`
102122
date-released: %s`, cm.Published))...)
103123
} else {
104-
now := time.Now()
105-
dt := now.Format("2006-01-02")
106124
src = append(src, []byte(fmt.Sprintf(`
107125
date-released: %s`, dt))...)
108126
}

version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package datatools
22

3-
const Version = "1.0.4"
3+
const Version = "1.0.5-dev"
44

0 commit comments

Comments
 (0)