Skip to content

Commit e7c55a7

Browse files
authored
fix npx y-sweet serve (#289)
1 parent 434bdca commit e7c55a7

File tree

3 files changed

+40
-33
lines changed

3 files changed

+40
-33
lines changed

js-pkg/server/package-lock.json

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js-pkg/server/src/get-binary.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ async function downloadFile(url, filePath) {
3838
}
3939

4040
exports.getBinary = async () => {
41-
let binpath = path.normalize(path.join(__dirname, '..', 'bin'))
41+
let bindir = path.normalize(path.join(__dirname, '..', 'bin'))
42+
fs.mkdirSync(bindir, { recursive: true })
43+
44+
let binpath = path.join(bindir, 'y-sweet')
45+
4246
if (fs.existsSync(binpath)) return binpath
4347

4448
let url = binaryUrl(VERSION, process.platform, process.arch)

js-pkg/server/src/install.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { getBinary } = require('./get-binary')
2+
3+
getBinary()

0 commit comments

Comments
 (0)