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

Commit

Permalink
Fixed build script on Windows. (#1769)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu-tow authored Aug 9, 2021
1 parent 220d8a8 commit 405a6b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"description": "Build Scripts",
"repository": "[email protected]:enso-org/ide.git",
"dependencies": {
"fs-extra": "^10.0.0",
"glob": "^7.1.6",
"js-yaml": "4.0.0",
"ncp": "^2.0.0",
"semver": "7.3.4",
"unzipper": "^0.10.11",
"yargs": "^15.3.0"
},
"license": "MIT",
Expand Down
19 changes: 9 additions & 10 deletions build/run.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const child_process = require('child_process')
const cmd = require('./cmd')
const fs = require('fs').promises
const fse = require('fs-extra')
const fss = require('fs')
const unzipper = require('unzipper')
const glob = require('glob')
const ncp = require('ncp').ncp
const os = require('os')
Expand Down Expand Up @@ -521,13 +523,11 @@ async function installJsDeps() {

async function downloadJsAssets() {
const workdir = path.join(paths.root, '.assets-temp')
await cmd.with_cwd(paths.root, async () => {
await cmd.run('mkdir', ['-p', workdir])
})
await fs.mkdir(workdir, {recursive:true})
const ideAssetsMainZip = 'ide-assets-main.zip'
const ideAssetsUrl = `https://github.com/enso-org/ide-assets/archive/refs/heads/main.zip`
const unzippedAssets = path.join(workdir, 'ide-assets-main', 'content', 'assets')
const jsLibAssets = path.join(paths.js.lib.content, 'assets')

await cmd.with_cwd(workdir, async () => {
await cmd.run('curl', [
'--retry',
Expand All @@ -536,15 +536,14 @@ async function downloadJsAssets() {
'-fsSL',
'-o',
ideAssetsMainZip,
'https://github.com/enso-org/ide-assets/archive/refs/heads/main.zip',
ideAssetsUrl,
])
await cmd.run('unzip', [ideAssetsMainZip])
})

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

async function runCommand(command, argv) {
Expand Down

0 comments on commit 405a6b2

Please sign in to comment.