Skip to content

Commit

Permalink
fix(paths): some paths were not pointing to the correct place when us…
Browse files Browse the repository at this point in the history
…ed with pkg
  • Loading branch information
ADRFranklin committed Mar 30, 2024
1 parent f049db4 commit 2b0e4d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"pkg": {
"scripts": [],
"assets": [
"./frontend/build/**/*"
"./pkg/frontend/build/**/*"
],
"targets": [
"node16-alpine-arm64",
Expand Down
7 changes: 3 additions & 4 deletions pkg/api/src/config/env/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ type PathsConfig = {
};

const proc: Process = process;
const ROOT_DIR = proc.pkg ? path.dirname(process.execPath) : proc.cwd();
const APP_DIR: string = proc.pkg
? path.join(__dirname, '../../../../../')
: proc.env.APP_DIR ?? path.join(ROOT_DIR, '../..');

const ROOT_DIR = proc.cwd();
const APP_DIR = proc.env.APP_DIR ?? path.join(__dirname, '../../..');
const VIEWS_DIR = process.env.VIEWS_FOLDER ?? path.join(APP_DIR, './pkg');
const DATA_DIR = process.env.DATA_FOLDER ?? path.join(ROOT_DIR, './data');

Expand Down

0 comments on commit 2b0e4d6

Please sign in to comment.