remove unused codes and update
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = path.resolve(__dirname, '../..');
|
||||
const tenantLogo = path.join(root, 'public-tis', 'branding', 'logo.png/');
|
||||
const defaultLogo = path.join(root, 'src', 'assets', 'images', 'logo.png');
|
||||
const targetLogo = path.join(root, 'src', 'tenants', 'tis', 'assets', 'images', 'logo.png');
|
||||
|
||||
const source = fs.existsSync(tenantLogo) ? tenantLogo : defaultLogo;
|
||||
|
||||
if (!fs.existsSync(source)) {
|
||||
console.warn(
|
||||
`[prepare-tis-logo] No logo source found. Checked: ${tenantLogo} and ${defaultLogo}`,
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
fs.mkdirSync(path.dirname(targetLogo), { recursive: true });
|
||||
fs.copyFileSync(source, targetLogo);
|
||||
console.log(
|
||||
`[prepare-tis-logo] Using logo: ${path.relative(root, source)} -> ${path.relative(root, targetLogo)}`,
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = process.cwd();
|
||||
const packageJsonPath = path.join(root, 'package.json');
|
||||
const ngswConfigPath = path.join(root, 'ngsw-config.json');
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||
const ngswConfig = JSON.parse(fs.readFileSync(ngswConfigPath, 'utf8'));
|
||||
|
||||
const now = new Date();
|
||||
const buildDate = process.env.TIS_BUILD_DATE || now.toISOString();
|
||||
const appVersion = process.env.TIS_APP_VERSION || packageJson.version || '0.0.0';
|
||||
|
||||
ngswConfig.appData = {
|
||||
...(ngswConfig.appData || {}),
|
||||
appVersion,
|
||||
buildDate,
|
||||
};
|
||||
|
||||
fs.writeFileSync(ngswConfigPath, `${JSON.stringify(ngswConfig, null, 2)}\n`);
|
||||
@@ -1,7 +1,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const root = process.cwd();
|
||||
const packageJsonPath = path.join(root, 'package.json');
|
||||
const ngswConfigPath = path.join(root, 'ngsw-config.json');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user