Browse Source

Windows support for runJob

master
meriadec 7 years ago
parent
commit
4e9d5df271
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 16
      package.json
  2. 14
      scripts/helpers/run-job.sh

16
package.json

@ -7,19 +7,19 @@
"author": "Ledger",
"license": "MIT",
"scripts": {
"postinstall": "./scripts/postinstall.sh",
"start": "./scripts/start.sh",
"release": "./scripts/release.sh",
"dist": "./scripts/dist.sh",
"dist:dir": "./scripts/dist-dir.sh",
"compile": "./scripts/compile.sh",
"postinstall": "bash ./scripts/postinstall.sh",
"start": "bash ./scripts/start.sh",
"release": "bash ./scripts/release.sh",
"dist": "bash ./scripts/dist.sh",
"dist:dir": "bash ./scripts/dist-dir.sh",
"compile": "bash ./scripts/compile.sh",
"lint": "eslint src webpack .storybook",
"flow": "flow",
"prettier": "prettier --write \"{src,webpack,.storybook,static/i18n}/**/*.{js,json}\"",
"ci": "yarn lint && yarn flow && yarn prettier",
"storybook": "NODE_ENV=development STORYBOOK_ENV=1 start-storybook -s ./static -p 4444",
"publish-storybook": "./scripts/legacy/publish-storybook.sh",
"reset-files": "./scripts/legacy/reset-files.sh"
"publish-storybook": "bash ./scripts/legacy/publish-storybook.sh",
"reset-files": "bash ./scripts/legacy/reset-files.sh"
},
"electronWebpack": {
"title": true,

14
scripts/helpers/run-job.sh

@ -3,6 +3,11 @@
# shellcheck disable=SC1091
source scripts/helpers/format.sh
operatingSystem=$(uname -s)
if [ "$operatingSystem" != Linux* ] && [ "$operatingSystem" != Darwin* ]; then
operatingSystem="Windows"
fi
function runJob {
job=$1
@ -11,6 +16,15 @@ function runJob {
errMsg=$4
logLevel=$5
# let's absolutely don't take care of this fake os
if [ "$operatingSystem" == "Windows" ]; then
local tmpScript=$(mktemp)
echo $job > "$tmpScript"
bash "$tmpScript"
rm "$tmpScript"
return $?
fi
tmpErrFile=$(mktemp)
formatProgress "$progressMsg"

Loading…
Cancel
Save