Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vscode-ui5-language-assistant-bas-ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.vsix
3 changes: 3 additions & 0 deletions packages/vscode-ui5-language-assistant-bas-ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# A wrapper module for BAS simple extension

This is a wrapper module for BAS simple extension around Language Support For SAPUI5.
28 changes: 28 additions & 0 deletions packages/vscode-ui5-language-assistant-bas-ext/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext",
"description": "A wrapper module for BAS simple extension around Language Support For SAPUI5",
"license": "Apache-2.0",
"version": "3.3.1",
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/SAP/ui5-language-assistant"
},
"scripts": {
"ci": "node ./scripts/copy"
},
"dependencies": {},
"devDependencies": {
"vscode-ui5-language-assistant": "3.3.1",
"fs-extra": "10.1.0"
},
"files": [
"*.vsix",
"README.md",
".reuse",
"LICENSES"
],
"publishConfig": {
"access": "public"
}
}
32 changes: 32 additions & 0 deletions packages/vscode-ui5-language-assistant-bas-ext/scripts/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { copySync, readdirSync } = require("fs-extra");
const { join } = require("path");

const baseSrc = join(__dirname, "..", "..", "vscode-ui5-language-assistant");
const baseDes = join(__dirname, "..");

const vsixFiles = [];
readdirSync(baseSrc).forEach((item) => {
if (item.endsWith(".vsix")) {
vsixFiles.push(item);
return item;
}
});
if (vsixFiles.length > 1) {
throw new Error(
`Detected more than one ".vsix" files. There should be only one ".vsix" file. Please cross check and try again.`,
{ cause: vsixFiles }
);
}
const vsixFile = vsixFiles.pop();
if (!vsixFile) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably combine these two checks with vsixFiles.length === 1

But this is not mandatory...

console.log(`There is not vsix under ${baseSrc}`);
throw new Error(
`There is no ".vsix" file. Please make sure a recent ".vsix" file is build under ${baseSrc} and try again.`,
{ cause: vsixFiles }
);
}
const srcVsix = join(baseSrc, vsixFile);
const destinationVsix = join(baseDes, vsixFile);
console.log(`Copying from ${srcVsix} to ${destinationVsix}`);
copySync(srcVsix, destinationVsix);
console.log("Copying finished successfully");