Skip to content

Commit

Permalink
add scripts_directory field to config
Browse files Browse the repository at this point in the history
  • Loading branch information
waymondrang committed Mar 13, 2022
1 parent 3b890a8 commit 8161afe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const version_exists = fs.existsSync(`${config.release_directory}/${config.proje
const browser_platforms = ["firefox"];
const chrome_platforms = ["chrome", "opera", "edge"];
const manifest_ignore = ["manifest_version"];
const scripts_directory = config.scripts_directory ? config.scripts_directory.endsWith("\\") ? config.scripts_directory : config.scripts_directory.concat("\\") : "";

var targets = config.targets;

Expand Down Expand Up @@ -190,7 +191,7 @@ if (will_copy) {
log("synced files between " + config.source.platform + " and " + targets.map(e => e.platform).join(", ") + " directories");
if (will_git) {
log("pushing synced directories to github");
execSync(`git.sh \"${config.git_messages.directory_sync}\"`);
execSync(`${scripts_directory}git.sh \"${config.git_messages.directory_sync}\"`);
}
} else {
log("skipped copying files");
Expand All @@ -201,7 +202,7 @@ if (will_package) {
var packages = targets;
packages.push(config.source);
for (var package of packages) {
execSync(`package.sh \"v${source_manifest.version}\" \"${config.project_name_short}\" \"${package.platform}\" \"${package.directory}\" \"${config.release_directory}\" \"${package.temp ? "--temp" : ""}`);
execSync(`${scripts_directory}package.sh \"v${source_manifest.version}\" \"${config.project_name_short}\" \"${package.platform}\" \"${package.directory}\" \"${config.release_directory}\" \"${package.temp ? "--temp" : ""}`);
log(`packaged ${source_manifest.version} for ` + package.platform);
if (package.temp) {
log("removing temporary target directory " + package.directory);
Expand All @@ -211,7 +212,7 @@ if (will_package) {
}
if (will_git) {
log("pushing completed packages to github");
execSync(`git.sh \"${config.git_messages.packages}\"`);
execSync(`${scripts_directory}git.sh \"${config.git_messages.packages}\"`);
}
} else {
log("skipping zipping files");
Expand Down
7 changes: 5 additions & 2 deletions build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"project_name_short": "extbuild",
"enforce_version_control": true,
"clean_manifest": true,
"default_actions": ["copy"],
"default_actions": [
"copy"
],
"release_directory": "./releases",
"source": {
"directory": "./src/chrome",
Expand All @@ -29,5 +31,6 @@
"directory_sync": "automated directory sync",
"packages": "automated package build"
},
"debug": false
"debug": false,
"scripts_directory": "build_scripts\\"
}

0 comments on commit 8161afe

Please sign in to comment.