-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Garifullin Ruslan
committed
Jan 5, 2021
1 parent
52dc643
commit a03cf50
Showing
4 changed files
with
52 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const {https} = require('follow-redirects'); | ||
const { dirname, join } = require('path'); | ||
const { https } = require('follow-redirects'); | ||
|
||
const {platform} = process; | ||
const {arch} = process; | ||
const { platform } = process; | ||
const { arch } = process; | ||
const version = 'v0.26.0'; | ||
|
||
const binPath = path.join(__dirname, 'node_modules/@nodegui/nodegui/build/Release/nodegui_core.node'); | ||
const binPath = join(__dirname, 'node_modules/@nodegui/nodegui/build/Release/nodegui_core.node'); | ||
|
||
if (fs.existsSync(binPath)) {return process.exit(0);} | ||
if (!fs.existsSync(binPath)) { | ||
fs.mkdirSync(dirname(binPath), { recursive: true }); | ||
|
||
fs.mkdirSync(path.dirname(binPath), { recursive: true }); | ||
const dlPath = `https://github.com/ruslang02/nodegui-bin/releases/download/${version}/nodegui_core-${platform}-${arch}.node`; | ||
const file = fs.createWriteStream(binPath); | ||
|
||
const dlPath = `https://github.com/ruslang02/nodegui-bin/releases/download/${version}/nodegui_core-${platform}-${arch}.node`; | ||
|
||
const file = fs.createWriteStream(binPath); | ||
|
||
https.get(dlPath, r => r.pipe(file)); | ||
https.get(dlPath, (r) => r.pipe(file)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/usr/bin/env node | ||
const cp = require('child_process'); | ||
|
||
const { log, error } = console; | ||
|
||
const proc = cp.spawn('npm run start', { | ||
shell: true, | ||
cwd: __dirname | ||
cwd: __dirname, | ||
}); | ||
|
||
proc.stdout.on('data', (chunk) => console.log(chunk.toString())); | ||
proc.stderr.on('data', (chunk) => console.error(chunk.toString())); | ||
proc.stdout.on('data', (chunk) => log(chunk.toString())); | ||
proc.stderr.on('data', (chunk) => error(chunk.toString())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters