Skip to content

Commit a9e515f

Browse files
committed
build: add gistr.js for env processing
1 parent 85c5231 commit a9e515f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
!*CONTRIBUTE.md
1414
!*CONTRIBUTING.md
1515

16+
# ----------------------------------------
17+
# [WL]: Electron
18+
# ----------------------------------------
19+
!/electron
20+
21+
1622
# ----------------------------------------
1723
# [WL]: Test Folder
1824
# ----------------------------------------
@@ -61,6 +67,7 @@
6167
# ----------------------------------------
6268
# [WL]: Base Files
6369
# ----------------------------------------
70+
!*gistr.js
6471
!*manifest.json
6572
!*package.json
6673
!*package-lock.json

gistr.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env node
2+
3+
// Execute:
4+
// npx --quiet env-cmd --no-override node gistr.js version
5+
// npx --quiet env-cmd --no-override node gistr.js guid
6+
// npx --quiet env-cmd --no-override node gistr.js uuid
7+
8+
const args = process.argv.slice( 2, process.argv.length );
9+
const action = args[ 0 ];
10+
const a = args[ 1 ];
11+
const b = args[ 2 ];
12+
13+
if ( action === "guid" )
14+
{
15+
console.log( `${ process.env.GUID }` );
16+
}
17+
else if( action === "uuid" )
18+
{
19+
console.log( `${ process.env.UUID }` );
20+
}
21+
else
22+
{
23+
console.log( require( './package.json' ).version );
24+
}
25+
26+
process.exit( 0 );

0 commit comments

Comments
 (0)