Skip to content

Commit bf2f8e4

Browse files
committed
Using resolve to resolve external file path
1 parent c87a49d commit bf2f8e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

entrypoint.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ process.env.LOCALIZATION_ROOT = localizationRoot;
4646

4747
try {
4848
if (action === 'push') {
49-
execSync('node ./dist/scripts/push-json-to-google-sheets.js', { stdio: 'inherit' });
49+
const scriptPath = require.resolve('./dist/scripts/push-json-to-google-sheets.js');
50+
execSync(`node ${scriptPath}`, { stdio: 'inherit' });
5051
} else if (action === 'pull') {
51-
execSync('node ./dist/scripts/pull-google-sheets-to-json.js', { stdio: 'inherit' });
52+
const scriptPath = require.resolve('./dist/scripts/pull-google-sheets-to-json.js');
53+
execSync(`node ${scriptPath}`, { stdio: 'inherit' });
5254
} else {
5355
core.setFailed(`Unknown action: ${action}`);
5456
process.exit(1);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"cpx": "^1.5.0"
1515
},
1616
"scripts": {
17-
"build": "cpx scripts/**/* dist/scripts && ncc build entrypoint.js -o dist",
17+
"build": "ncc build entrypoint.js -o dist && cpx 'scripts/**/*' dist/scripts",
1818
"test": "jest"
1919
}
2020
}

0 commit comments

Comments
 (0)