Files
lnreader/scripts/setEnvFile.cjs
T
Justin COLLON aec6c34b66 Update: Version utils & Github actions (#1072)
* github action:
 - custom apk:
   - packet name with git commit id
   - app name with git commit id
 - cached `npm install`
 - update actions versions

* About page:
 - Version based on package.json
 - added git hash to the version if not Stable
 - RELEASE_DATE, GIT_HASH, BUILD_TYPE created at build time from setEnvFile.cjs
 - special BUILD_TYPE for github actions
 - Version modal copy on click
 - removed versionUtils

* expo-clipboard instead of react-native clipboard

* buildRelease Release instead of Debug ^^'
Gihtub Actions => Github Action
2024-05-31 00:00:07 +07:00

24 lines
542 B
JavaScript

const fs = require('fs');
const os = require('os');
const path = require('path');
const { execSync } = require('child_process');
const formattedDate = new Date().getTime();
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
const buildType = process.argv[2] || 'Beta';
let data =
`BUILD_TYPE=${buildType}` +
os.EOL +
`GIT_HASH=${commitHash}` +
os.EOL +
`RELEASE_DATE=${formattedDate}`;
fs.writeFile(path.join(__dirname, '..', '.env'), data, 'utf8', err => {
if (err) {
console.log(err);
}
});