Skip to content

Commit de4eb8a

Browse files
authored
feat: create new module for bas extension (#544)
* feat: create new module for bas extension * fix: review comments
1 parent 36161c7 commit de4eb8a

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.vsix
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# A wrapper module for BAS simple extension
2+
3+
This is a wrapper module for BAS simple extension around Language Support For SAPUI5.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext",
3+
"description": "A wrapper module for BAS simple extension around Language Support For SAPUI5",
4+
"license": "Apache-2.0",
5+
"version": "3.3.1",
6+
"private": false,
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/SAP/ui5-language-assistant"
10+
},
11+
"scripts": {
12+
"ci": "node ./scripts/copy"
13+
},
14+
"dependencies": {},
15+
"devDependencies": {
16+
"vscode-ui5-language-assistant": "3.3.1",
17+
"fs-extra": "10.1.0"
18+
},
19+
"files": [
20+
"*.vsix",
21+
"README.md",
22+
".reuse",
23+
"LICENSES"
24+
],
25+
"publishConfig": {
26+
"access": "public"
27+
}
28+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const { copySync, readdirSync } = require("fs-extra");
2+
const { join } = require("path");
3+
4+
const baseSrc = join(__dirname, "..", "..", "vscode-ui5-language-assistant");
5+
const baseDes = join(__dirname, "..");
6+
7+
const vsixFiles = [];
8+
readdirSync(baseSrc).forEach((item) => {
9+
if (item.endsWith(".vsix")) {
10+
vsixFiles.push(item);
11+
return item;
12+
}
13+
});
14+
if (vsixFiles.length > 1) {
15+
throw new Error(
16+
`Detected more than one ".vsix" files. There should be only one ".vsix" file. Please cross check and try again.`,
17+
{ cause: vsixFiles }
18+
);
19+
}
20+
const vsixFile = vsixFiles.pop();
21+
if (!vsixFile) {
22+
console.log(`There is not vsix under ${baseSrc}`);
23+
throw new Error(
24+
`There is no ".vsix" file. Please make sure a recent ".vsix" file is build under ${baseSrc} and try again.`,
25+
{ cause: vsixFiles }
26+
);
27+
}
28+
const srcVsix = join(baseSrc, vsixFile);
29+
const destinationVsix = join(baseDes, vsixFile);
30+
console.log(`Copying from ${srcVsix} to ${destinationVsix}`);
31+
copySync(srcVsix, destinationVsix);
32+
console.log("Copying finished successfully");

0 commit comments

Comments
 (0)