Skip to content

Commit 8f291f4

Browse files
automate build script some more
1 parent 61d801d commit 8f291f4

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

build.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1+
const version = 11;
2+
const day = 7;
3+
const expiresDay = 8;
4+
5+
if (version % 2 === 0) {
6+
month = 'December';
7+
expiresMonth = 'June';
8+
} else {
9+
month = 'June';
10+
expiresMonth = 'December';
11+
}
12+
const year = Math.floor(2013 + (version - 1) / 2);
13+
const expiresYear = Math.floor(2013 + version / 2);
14+
const date = `${day} ${month} ${year}`;
15+
const expires = `${expiresDay} ${expiresMonth} ${expiresYear}`;
16+
const monthYear = (month === 'June' ? ' ' : '') + month + ' ' + year;
17+
118
var fs = require('fs'),
219
lines = fs.readFileSync('source.txt').toString().split('\n'),
320
breaker1a = '\n\nde Jong [Page ',
421
breaker1b = '\n\nde Jong [Page ',
522
breaker2 = ']',
6-
breaker3 = '\n\nInternet-Draft remoteStorage June 2018\n\n',
23+
breaker3 = '\n\nInternet-Draft remoteStorage '+ monthYear + '\n\n',
724
page = 1, line = 0;
825

926
while (line < lines.length) {
27+
lines[line] = lines[line].split('${EXPIRES}').join(expires);
28+
lines[line] = lines[line].split('${DATE}').join(date);
29+
lines[line] = lines[line].split('${YEAR}').join(year);
30+
lines[line] = lines[line].split('${VERSION}').join(version);
1031
console.log(lines[line]);
1132
if (lines[line].length > 72) {
1233
console.log('123456789012345678901234567890123456789012345678901234567890123456789012*****');

source.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
INTERNET DRAFT Michiel B. de Jong
2-
Document: draft-dejong-remotestorage-11 (independent)
2+
Document: draft-dejong-remotestorage-${VERSION} (independent)
33
F. Kooman
44
Intended Status: Proposed Standard (independent)
5-
Expires: 8 December 2018 7 June 2018
5+
Expires: ${EXPIRES} ${DATE}
66

77

88
remoteStorage
@@ -32,11 +32,11 @@ Status of this Memo
3232
time. It is inappropriate to use Internet-Drafts as reference
3333
material or to cite them other than as "work in progress."
3434

35-
This Internet-Draft will expire on 8 December 2018.
35+
This Internet-Draft will expire on ${EXPIRES}.
3636

3737
Copyright Notice
3838

39-
Copyright (c) 2018 IETF Trust and the persons identified as the
39+
Copyright (c) ${YEAR} IETF Trust and the persons identified as the
4040
document authors. All rights reserved.
4141

4242
This document is subject to BCP 78 and the IETF Trust's Legal

0 commit comments

Comments
 (0)