Simplify main.js
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
This commit is contained in:
@@ -12,19 +12,8 @@
|
|||||||
// # See the License for the specific language governing permissions and
|
// # See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
const spawn = require('child_process').spawn
|
const spawnSync = require('child_process').spawnSync;
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const main = async () => {
|
const proc = spawnSync('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'});
|
||||||
await new Promise((resolve, reject) => {
|
process.exit(proc.status)
|
||||||
const proc = spawn('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'})
|
|
||||||
proc.on('close', resolve)
|
|
||||||
proc.on('error', reject)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
main().catch(err => {
|
|
||||||
console.error(err)
|
|
||||||
console.error(err.stack)
|
|
||||||
process.exit(-1)
|
|
||||||
})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user