-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from 10up/update/207
E2Eon build zip
- Loading branch information
Showing
8 changed files
with
79 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: Build release zip | |
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
branches: | ||
- trunk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["."] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs'); | ||
|
||
const path = `${process.cwd()}/.wp-env.override.json`; | ||
|
||
let config = fs.existsSync(path) ? require(path) : { plugins: ['.'] }; | ||
|
||
const args = {}; | ||
process.argv.slice(2, process.argv.length).forEach((arg) => { | ||
if (arg.slice(0, 2) === '--') { | ||
const param = arg.split('='); | ||
const paramName = param[0].slice(2, param[0].length); | ||
const paramValue = param.length > 1 ? param[1] : true; | ||
args[paramName] = paramValue; | ||
} | ||
}); | ||
|
||
if (!args.core && !args.plugins) { | ||
return; | ||
} | ||
|
||
if ('latest' === args.core) { | ||
delete args.core; | ||
} | ||
|
||
if (Object.keys(args).length === 0) { | ||
return; | ||
} | ||
|
||
if (args.plugins) { | ||
args.plugins = args.plugins.split(','); | ||
} | ||
|
||
config = { | ||
...config, | ||
...args, | ||
}; | ||
|
||
try { | ||
fs.writeFileSync(path, JSON.stringify(config)); | ||
} catch (err) { | ||
console.error(err); | ||
} |