Skip to content

Commit

Permalink
Terminal and download update
Browse files Browse the repository at this point in the history
- Changed that it uses the same terminal or creates one
- removed reload from download and update
  • Loading branch information
Laffey-chan committed May 4, 2023
1 parent 6fdae6e commit ee2c3ea
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function activate(context: vscode.ExtensionContext) {
removeFolder(repoFolderPath,["cinema","consts","doc","effect","environment","events","functions","info","map","model","objects"]);
await copyFolder(tempFolderPath, repoFolderPath,[".gitignore","package-lock.json","heckExporter.py","package.json","README.md","script.ts","functions.ts"]); // Copy the contents of the temporary folder to the workspace folder
await removeFolder(tempFolderPath); // Remove the temporary folder
vscode.commands.executeCommand('workbench.action.reloadWindow');
vscode.window.showInformationMessage('HeckLib Updated');
});
let download = vscode.commands.registerCommand('test.Download-HeckLib',async () => {
Expand All @@ -54,9 +53,8 @@ export function activate(context: vscode.ExtensionContext) {
tempFolderPath = path.join(tempFolderPath, 'HeckLib');
await copyFolder(tempFolderPath, repoFolderPath , [".gitignore","package-lock.json","heckExporter.py","package.json","README.md"]); // Copy the contents of the temporary folder to the workspace folder
await removeFolder(tempFolderPath); // Remove the temporary folder
vscode.commands.executeCommand('workbench.action.reloadWindow').then( async () => {
vscode.window.showInformationMessage('HeckLib Downloaded');
});
vscode.commands.executeCommand('setContext', 'myExtension.file', true);
vscode.window.showInformationMessage('HeckLib Downloaded');
});
let downloadDep = vscode.commands.registerCommand('test.Download-HeckLib-Dependencies',async () => {
const terminal = vscode.window.createTerminal();
Expand All @@ -65,7 +63,7 @@ export function activate(context: vscode.ExtensionContext) {
await terminal.sendText('npm install @types/node')
});
let run = vscode.commands.registerCommand('test.Run-HeckLib',async () => {
const terminal = vscode.window.createTerminal();
const terminal = vscode.window.terminals.find(t => t.name === 'HeckLib') || vscode.window.createTerminal('HeckLib');
terminal.show();
await terminal.sendText('nodemon ./script.ts -e ts');
});
Expand Down

0 comments on commit ee2c3ea

Please sign in to comment.