backfill 6.4.7 → 6.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commandRunner.js +2 -2
- package/lib/commandRunner.js.map +1 -1
- package/package.json +4 -4
package/lib/commandRunner.js
CHANGED
|
@@ -18,7 +18,7 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
const _execa = /*#__PURE__*/ _interop_require_default(require("execa"));
|
|
20
20
|
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
21
|
-
const _globby = require("
|
|
21
|
+
const _globby = require("globby");
|
|
22
22
|
function _interop_require_default(obj) {
|
|
23
23
|
return obj && obj.__esModule ? obj : {
|
|
24
24
|
default: obj
|
|
@@ -34,7 +34,7 @@ function createBuildCommand(buildCommand, clearOutput, outputGlob, logger) {
|
|
|
34
34
|
throw new Error("Command not provided");
|
|
35
35
|
}
|
|
36
36
|
if (clearOutput) {
|
|
37
|
-
const filesToClear = (0, _globby.
|
|
37
|
+
const filesToClear = (0, _globby.sync)(outputGlob);
|
|
38
38
|
await Promise.all(filesToClear.map(async (file)=>await _fsextra.default.remove(file)));
|
|
39
39
|
}
|
|
40
40
|
try {
|
package/lib/commandRunner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commandRunner.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/commandRunner.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport { sync as globbySync } from \"globby\";\n\nimport type { Logger } from \"backfill-logger\";\n\nexport type ExecaReturns = execa.ExecaChildProcess;\nexport type BuildCommand = () => Promise<ExecaReturns | void>;\n\nexport function getRawBuildCommand(): string {\n return process.argv.slice(2).join(\" \");\n}\n\nexport function createBuildCommand(\n buildCommand: (string | number)[],\n clearOutput: boolean,\n outputGlob: string[],\n logger: Logger\n): () => Promise<ExecaReturns | void> {\n return async (): Promise<ExecaReturns | void> => {\n const parsedBuildCommand = buildCommand.join(\" \");\n\n if (!parsedBuildCommand) {\n throw new Error(\"Command not provided\");\n }\n\n if (clearOutput) {\n const filesToClear = globbySync(outputGlob);\n await Promise.all(\n filesToClear.map(async (file) => await fs.remove(file))\n );\n }\n\n try {\n // Set up runner\n const tracer = logger.setTime(\"buildTime\");\n const runner = execa(parsedBuildCommand, {\n shell: true,\n });\n\n logger.pipeProcessOutput(runner.stdout, runner.stderr);\n\n await runner;\n tracer.stop();\n } catch (e) {\n logger.error(`Failed while running: \"${parsedBuildCommand}\"`);\n throw e;\n }\n };\n}\n"],"names":["createBuildCommand","getRawBuildCommand","process","argv","slice","join","buildCommand","clearOutput","outputGlob","logger","parsedBuildCommand","Error","filesToClear","globbySync","Promise","all","map","file","fs","remove","tracer","setTime","runner","execa","shell","pipeProcessOutput","stdout","stderr","stop","e","error"],"mappings":";;;;;;;;;;;QAagBA;eAAAA;;QAJAC;eAAAA;;;8DATE;gEACH;wBACoB;;;;;;AAO5B,SAASA;IACd,OAAOC,QAAQC,IAAI,CAACC,KAAK,CAAC,GAAGC,IAAI,CAAC;AACpC;AAEO,SAASL,mBACdM,YAAiC,EACjCC,WAAoB,EACpBC,UAAoB,EACpBC,MAAc;IAEd,OAAO;QACL,MAAMC,qBAAqBJ,aAAaD,IAAI,CAAC;QAE7C,IAAI,CAACK,oBAAoB;YACvB,MAAM,IAAIC,MAAM;QAClB;QAEA,IAAIJ,aAAa;YACf,MAAMK,eAAeC,IAAAA,YAAU,EAACL;YAChC,MAAMM,QAAQC,GAAG,CACfH,aAAaI,GAAG,CAAC,OAAOC,OAAS,MAAMC,gBAAE,CAACC,MAAM,CAACF;QAErD;QAEA,IAAI;YACF,gBAAgB;YAChB,MAAMG,SAASX,OAAOY,OAAO,CAAC;YAC9B,MAAMC,SAASC,IAAAA,cAAK,EAACb,oBAAoB;gBACvCc,OAAO;YACT;YAEAf,OAAOgB,iBAAiB,CAACH,OAAOI,MAAM,EAAEJ,OAAOK,MAAM;YAErD,MAAML;YACNF,OAAOQ,IAAI;QACb,EAAE,OAAOC,GAAG;YACVpB,OAAOqB,KAAK,CAAC,CAAC,uBAAuB,EAAEpB,mBAAmB,CAAC,CAAC;YAC5D,MAAMmB;QACR;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backfill",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.8",
|
|
4
4
|
"description": "Backfill CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Benjamin Weggersen <bewegger@microsoft.com>",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"test": "yarn run -T jest"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@lage-run/globby": "^13.0.2",
|
|
24
23
|
"anymatch": "^3.1.3",
|
|
25
|
-
"backfill-cache": "^5.12.
|
|
24
|
+
"backfill-cache": "^5.12.3",
|
|
26
25
|
"backfill-config": "^6.7.2",
|
|
27
|
-
"backfill-hasher": "^6.7.
|
|
26
|
+
"backfill-hasher": "^6.7.3",
|
|
28
27
|
"backfill-logger": "^5.4.1",
|
|
29
28
|
"backfill-utils-dotenv": "^5.3.2",
|
|
30
29
|
"chokidar": "^3.6.0",
|
|
31
30
|
"execa": "^5.1.1",
|
|
32
31
|
"find-up": "^5.0.0",
|
|
33
32
|
"fs-extra": "^8.1.0",
|
|
33
|
+
"globby": "^11.1.0",
|
|
34
34
|
"yargs": "^16.2.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|