Skip to content

Commit cae09ad

Browse files
committed
Fix server building to be platform independent
1 parent 287e740 commit cae09ad

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

build/copyLicensingToOut.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
4+
const sourceDir = path.join(__dirname, '..', 'src', 'licensing', 'gui', 'build')
5+
const targetDir = path.join(__dirname, '..', 'out', 'licensing', 'static')
6+
7+
fs.cp(sourceDir, targetDir, { recursive: true }, (err) => {
8+
if (err) {
9+
console.error('Error copying files: ', err)
10+
} else {
11+
console.log('Files copied successfully.')
12+
}
13+
})

build/makeLicensingOut.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
4+
const dirPath = path.join(__dirname, '..', 'out', 'licensing', 'static')
5+
6+
fs.mkdir(dirPath, { recursive: true }, (err) => {
7+
if (err) {
8+
console.error('Error creating directory: ', err)
9+
} else {
10+
console.log('Directory created successfully: ', dirPath)
11+
}
12+
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bin": "./out/index.js",
77
"scripts": {
88
"vscode:prepublish": "npm run package",
9-
"compile": "webpack --mode development && mkdir -p ./out/licensing/static && cd src/licensing/gui && npm run build && cd ../../.. && cp -R src/licensing/gui/build/* ./out/licensing/static",
9+
"compile": "webpack --mode development && node ./build/makeLicensingOut.js && cd src/licensing/gui && npm run build && cd ../../.. && node ./build/copyLicensingToOut.js",
1010
"watch": "webpack --watch",
1111
"package": "webpack --mode production --devtool hidden-source-map",
1212
"test-compile": "tsc -p ./",

0 commit comments

Comments
 (0)