bunosh 0.1.3 → 0.1.5
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/index.js +15 -2
- package/package.json +4 -2
- package/run.js +15 -4
package/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import program from "./src/program";
|
|
2
2
|
import exec from "./src/tasks/exec";
|
|
3
3
|
import fetch from "./src/tasks/fetch";
|
|
4
|
-
import writeToFile from "./tasks/writeToFile";
|
|
4
|
+
import writeToFile from "./src/tasks/writeToFile";
|
|
5
5
|
import io from "./src/io";
|
|
6
6
|
|
|
7
7
|
import { task, stopOnFail, ignoreFail } from "./src/task";
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
export { program as bunosh };
|
|
11
10
|
|
|
12
11
|
export { io, exec, fetch, task, stopOnFail, ignoreFail, writeToFile };
|
|
@@ -17,3 +16,17 @@ export function buildCmd(cmd) {
|
|
|
17
16
|
return exec`${cmd} ${args}`
|
|
18
17
|
}
|
|
19
18
|
}
|
|
19
|
+
|
|
20
|
+
global.bunosh = {
|
|
21
|
+
...io,
|
|
22
|
+
fetch,
|
|
23
|
+
exec,
|
|
24
|
+
writeToFile,
|
|
25
|
+
copyFile,
|
|
26
|
+
stopOnFail,
|
|
27
|
+
ignoreFail,
|
|
28
|
+
task,
|
|
29
|
+
buildCmd,
|
|
30
|
+
$: exec,
|
|
31
|
+
}
|
|
32
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunosh",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"module": "index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bunosh": "./run.js"
|
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
"prettier": "^3.2.4",
|
|
11
11
|
"lint-staged": "^15.2.0"
|
|
12
12
|
},
|
|
13
|
+
"types": "index.d.ts",
|
|
13
14
|
"dependencies": {
|
|
14
15
|
"@babel/parser": "^7.23.6",
|
|
15
16
|
"@babel/traverse": "^7.23.7",
|
|
17
|
+
"@types/node-fetch": "^2.6.11",
|
|
16
18
|
"cfonts": "^3.2.0",
|
|
17
19
|
"chalk": "^5.3.0",
|
|
18
20
|
"commander": "^11.1.0",
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
"files.js",
|
|
36
38
|
"src",
|
|
37
39
|
"templates"
|
|
38
|
-
],
|
|
40
|
+
],
|
|
39
41
|
"lint-staged": {
|
|
40
42
|
"*.{js,css,md}": "prettier --write"
|
|
41
43
|
},
|
package/run.js
CHANGED
|
@@ -3,7 +3,11 @@ import program, { BUNOSHFILE, banner } from "./src/program";
|
|
|
3
3
|
import { existsSync, readFileSync } from "fs";
|
|
4
4
|
import init from "./src/init";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import
|
|
6
|
+
import io from './src/io';
|
|
7
|
+
import fetch from './src/tasks/fetch';
|
|
8
|
+
import writeToFile from "./src/tasks/writeToFile";
|
|
9
|
+
import copyFile from "./src/tasks/copyFile";
|
|
10
|
+
import exec from "./src/tasks/exec";
|
|
7
11
|
|
|
8
12
|
const tasksFile = path.join(process.cwd(), BUNOSHFILE);
|
|
9
13
|
|
|
@@ -19,13 +23,20 @@ if (!existsSync(tasksFile)) {
|
|
|
19
23
|
console.error(`Bunosh file not found: ${tasksFile}`);
|
|
20
24
|
console.log("Run `bunosh init` to create a new bunosh tasks file here")
|
|
21
25
|
console.log();
|
|
22
|
-
process.ar
|
|
23
26
|
process.exit(1);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
global.
|
|
27
|
-
|
|
29
|
+
global.bunosh = {
|
|
30
|
+
...io,
|
|
31
|
+
fetch,
|
|
32
|
+
exec,
|
|
33
|
+
writeToFile,
|
|
34
|
+
copyFile,
|
|
35
|
+
}
|
|
28
36
|
|
|
29
37
|
import(tasksFile).then((tasks) => {
|
|
30
38
|
program(tasks, readFileSync(tasksFile, "utf-8"));
|
|
39
|
+
}).catch((e) => {
|
|
40
|
+
console.error(`Error loading: ${tasksFile}`);
|
|
41
|
+
console.error(e);
|
|
31
42
|
});
|