Skip to content

Commit 4f4d146

Browse files
committedJun 22, 2022
temporary code to show shell execution
1 parent 861fd81 commit 4f4d146

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed
 

‎hooks/basic_hooks.js

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1+
import { exec } from "child_process";
2+
13
export const basic_get_package_manager = () => {
24
console.log("Checking package manager");
35
return "yarn";
46
};
7+
8+
export const basic_check_shell_connectivity = () => {
9+
console.log("Checking shell connectivity");
10+
exec("sh ./scripts/sample.sh", (error, stdout, stderr) => {
11+
if (error) {
12+
console.log(`error: ${error.message}`);
13+
return;
14+
}
15+
if (stderr) {
16+
console.log(`stderr: ${stderr}`);
17+
return;
18+
}
19+
console.log(`stdout: ${stdout}`);
20+
});
21+
};

‎lib/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const log = function (text) {
2424
};
2525

2626
export const invoke_process = () => {
27+
hooks.basic_check_shell_connectivity();
2728
// Step 1: Sanity check
2829
console.log("> Checking github connectivity");
2930
hooks.git_test_connection("application");

‎package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
},
2020
"homepage": "https://reactplay.io/",
2121
"dependencies": {
22+
"child-process": "^1.0.2",
2223
"prompt": "^1.3.0"
2324
},
24-
"repository": "git://github.com/reactplay/react-play-dev-kit.git"
25+
"repository": "git://github.com/reactplay/react-play-dev-kit.git",
26+
"publishConfig": {
27+
"registry": "https://npm.pkg.github.com"
28+
}
2529
}

‎scripts/sample.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
echo "This log is from shell script"

0 commit comments

Comments
 (0)
Please sign in to comment.