-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,7 @@ Thumbs.db | |
|
||
# Angular | ||
.angular/ | ||
|
||
|
||
/src/environments/environment.prod.ts | ||
/src/environments/version.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const path = require('path'); | ||
const colors = require('colors/safe'); | ||
const fs = require('fs'); | ||
|
||
console.log(colors.cyan('\nRunning pre-build tasks')); | ||
|
||
var appVersion; | ||
|
||
try { | ||
appVersion = require('../../package.json').version; | ||
} catch { | ||
console.warn('Could not import package.json.'); | ||
appVersion = undefined; | ||
} | ||
|
||
const versionFilePath = path.join( | ||
__dirname + '/../src/environments/version.ts' | ||
); | ||
const src = `export const version = '${appVersion}'; | ||
`; | ||
|
||
// ensure version module pulls value from package.json | ||
fs.writeFile(versionFilePath, src, { flat: 'w' }, function (err) { | ||
if (err) { | ||
return console.log(colors.red(err)); | ||
} | ||
|
||
console.log( | ||
colors.green( | ||
`Updating application version ${colors.yellow(appVersion)}` | ||
) | ||
); | ||
console.log( | ||
`${colors.green('Writing version module to ')}${colors.yellow( | ||
versionFilePath | ||
)}\n` | ||
); | ||
console.log(src); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version=`grep -o '\d\+\.\d\+\.\d\+' package.json` | ||
today=`date +'%Y-%m-%d'` | ||
sed -i '' "s/^version:.*$/version: $version/g" CITATION.cff | ||
sed -i '' "s/^date-released:.*$/date-released: \'$today\'/g" CITATION.cff |