Skip to content

Commit c59e581

Browse files
committed
ok to run jsdos backend
1 parent b79b5bb commit c59e581

File tree

8 files changed

+436
-46
lines changed

8 files changed

+436
-46
lines changed

masm-tasm/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ node_modules
66
*.vsix
77

88
**/.DS_store
9-
10-
**.jsdos
9+
dev/*.tgz
10+
resources/*.zip

masm-tasm/dev/downloadBundle.js

+21-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
const { existsSync,copyFileSync } = require('fs');
2-
const path = require('path');
3-
const pkg = require("../package.json");
1+
const fetch = require('node-fetch');
2+
const {HttpProxyAgent }= require('http-proxy-agent');
3+
const fs=require("fs")
44

5-
const actions = pkg.contributes.configuration.properties['masmtasm.ASM.actions'].default
6-
const assemblers = Object.keys(actions).map(key => actions[key].baseBundle.replace('<built-in>/', ""));
75

8-
const srcFolder = path.resolve(__dirname,"..","..","bundles")
9-
const dstFolder = path.resolve(__dirname, "..", "resources");
6+
const url = "https://dosasm.github.io/dosplay/jsdos-bundle/";
107

11-
async function main() {
12-
for (const asm of assemblers) {
13-
const dst = path.resolve(dstFolder, asm);
14-
const src = path.resolve(srcFolder, asm);
15-
if(!existsSync(src)){
16-
console.warn("can't find file "+src+"[skip]");
17-
continue
18-
}
19-
if (existsSync(dst)) {
20-
console.log('already added', asm)
21-
} else {
22-
console.log(src,dstFolder)
23-
copyFileSync(src,dst)
24-
}
8+
const proxy = 'http://127.0.0.1:7890';
9+
const agent = new HttpProxyAgent(proxy);
10+
11+
async function main(params) {
12+
let a=await fetch(url+"info.json");
13+
let info=await a.json()
14+
console.log(info)
15+
for (const b of info.bundles){
16+
console.log(b)
17+
const response=await fetch(url+b.filepath)
18+
const fileStream = fs.createWriteStream("./resources/"+b.name+".zip");
19+
response.body.pipe(fileStream);
20+
await new Promise((resolve, reject) => {
21+
fileStream.on('finish', resolve);
22+
fileStream.on('error', reject);
23+
});
2524
}
2625
}
27-
28-
main()
26+
main()

masm-tasm/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
},
174174
"default": {
175175
"TASM": {
176-
"baseBundle": "<built-in>/TASM.jsdos",
176+
"baseBundle": "<built-in>/TASM.zip",
177177
"before": [
178178
"set PATH=C:\\TASM"
179179
],
@@ -190,7 +190,7 @@
190190
]
191191
},
192192
"MASM-v6.11": {
193-
"baseBundle": "<built-in>/MASM-v6.11.jsdos",
193+
"baseBundle": "<built-in>/MASM-v6.11.zip",
194194
"before": [
195195
"set PATH=C:\\MASM"
196196
],
@@ -206,7 +206,7 @@
206206
]
207207
},
208208
"MASM-v5.00": {
209-
"baseBundle": "<built-in>/MASM-v5.00.jsdos",
209+
"baseBundle": "<built-in>/MASM-v5.00.zip",
210210
"before": [
211211
"set PATH=C:\\MASM"
212212
],
@@ -472,9 +472,10 @@
472472
"assert": "^2.0.0",
473473
"del": "^7.0.0",
474474
"download": "^8.0.0",
475-
"emulators": "https://raw.githubusercontent.com/dosasm/dosplay/gh-pages/emulators-v8.3.3-dosasm10.tgz",
475+
"emulators": "./dev/emulators-v8.3.3-dosasm11.tgz",
476476
"eslint": "^8.20.0",
477477
"glob": "^8.0.3",
478+
"http-proxy-agent": "^7.0.2",
478479
"js-yaml": "^4.1.0",
479480
"jszip": "^3.10.0",
480481
"mocha": "^10.0.0",

masm-tasm/pnpm-lock.yaml

+26-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)