Skip to content
This repository was archived by the owner on Dec 28, 2021. It is now read-only.

Commit 405a6b2

Browse files
authored
Fixed build script on Windows. (#1769)
1 parent 220d8a8 commit 405a6b2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

build/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"description": "Build Scripts",
55
"repository": "git@github.com:enso-org/ide.git",
66
"dependencies": {
7+
"fs-extra": "^10.0.0",
78
"glob": "^7.1.6",
89
"js-yaml": "4.0.0",
910
"ncp": "^2.0.0",
1011
"semver": "7.3.4",
12+
"unzipper": "^0.10.11",
1113
"yargs": "^15.3.0"
1214
},
1315
"license": "MIT",

build/run.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const child_process = require('child_process')
22
const cmd = require('./cmd')
33
const fs = require('fs').promises
4+
const fse = require('fs-extra')
45
const fss = require('fs')
6+
const unzipper = require('unzipper')
57
const glob = require('glob')
68
const ncp = require('ncp').ncp
79
const os = require('os')
@@ -521,13 +523,11 @@ async function installJsDeps() {
521523

522524
async function downloadJsAssets() {
523525
const workdir = path.join(paths.root, '.assets-temp')
524-
await cmd.with_cwd(paths.root, async () => {
525-
await cmd.run('mkdir', ['-p', workdir])
526-
})
526+
await fs.mkdir(workdir, {recursive:true})
527527
const ideAssetsMainZip = 'ide-assets-main.zip'
528+
const ideAssetsUrl = `https://github.com/enso-org/ide-assets/archive/refs/heads/main.zip`
528529
const unzippedAssets = path.join(workdir, 'ide-assets-main', 'content', 'assets')
529530
const jsLibAssets = path.join(paths.js.lib.content, 'assets')
530-
531531
await cmd.with_cwd(workdir, async () => {
532532
await cmd.run('curl', [
533533
'--retry',
@@ -536,15 +536,14 @@ async function downloadJsAssets() {
536536
'-fsSL',
537537
'-o',
538538
ideAssetsMainZip,
539-
'https://github.com/enso-org/ide-assets/archive/refs/heads/main.zip',
539+
ideAssetsUrl,
540540
])
541-
await cmd.run('unzip', [ideAssetsMainZip])
542541
})
543542

544-
await cmd.with_cwd(paths.root, async () => {
545-
await cmd.run('cp', ['-r', unzippedAssets, paths.js.lib.content])
546-
await cmd.run('rm', ['-r', workdir])
547-
})
543+
const assetsArchive = await unzipper.Open.file(path.join(workdir,ideAssetsMainZip))
544+
await assetsArchive.extract({path: workdir})
545+
await fse.copy(unzippedAssets,jsLibAssets)
546+
await fse.remove(workdir)
548547
}
549548

550549
async function runCommand(command, argv) {

0 commit comments

Comments
 (0)