Skip to content

Commit

Permalink
extract zip filename to the constant
Browse files Browse the repository at this point in the history
  • Loading branch information
maximtop committed Apr 2, 2024
1 parent 4351821 commit c49026f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/examples/adguard-api/scripts/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { copyWar } from '@adguard/tswebextension/cli';
import path from 'path';
import { buildRunner } from './build-runner';
import { config } from './webpack.config';
import { BUILD_PATH, WEB_ACCESSIBLE_RESOURCES_PATH } from '../constants';
import { BUILD_PATH, BUILD_ZIP_FILE_NAME, WEB_ACCESSIBLE_RESOURCES_PATH } from '../constants';
import { zipDirectory } from './zip-directory';

const build = async () => {
try {
await buildRunner(config);
await copyWar(WEB_ACCESSIBLE_RESOURCES_PATH);
await zipDirectory(BUILD_PATH, path.join(BUILD_PATH, '../extension.zip'));
await zipDirectory(BUILD_PATH, path.join(BUILD_PATH, '..', BUILD_ZIP_FILE_NAME));
} catch (e) {
console.log(e);
process.exit(1);
Expand Down
2 changes: 2 additions & 0 deletions packages/examples/adguard-api/scripts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import path from 'path';

export const BUILD_PATH = path.join(__dirname, '../build/extension');

export const BUILD_ZIP_FILE_NAME = 'extension.zip';

export const WEB_ACCESSIBLE_RESOURCES_PATH = path.join(__dirname, '../build/extension/adguard');

export const BACKGROUND_PATH = path.join(__dirname, '../extension/pages/background');
Expand Down

0 comments on commit c49026f

Please sign in to comment.