You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't found any way to check when my terminal process ends. So, i hard coded a delay of 4 s after my terminal process starts.
function genEnvironment(folderPath, additionalCommand = "") {
const originalFolderPath = folderPath;
folderPath = `'${folderPath}'`; // to fix that if their is space in between the path.
const terminal = vscode.window.createTerminal(`bash`);
terminal.show(true);
terminal.sendText(`cd ${folderPath}`);
terminal.sendText(`python3 -m venv env || python -m venv env`);
terminal.sendText(`source ${folderPath}/env/bin/activate`);
if (additionalCommand != "")
terminal.sendText(additionalCommand); // can be used for pip install flask
terminal.sendText(`pip freeze > ${folderPath}/requirements.txt`);
terminal.sendText(`deactivate`);
terminal.sendText(`exit`);
sleep(4000).then(() => commands.openInNewWindow(originalFolderPath));
}
PATH TO THIS FUNCTION = scripts/generate.js
The text was updated successfully, but these errors were encountered:
iamAbhishekkumar
changed the title
Call open in new window only when the terminal process ends.
"Call open in new window" only when the terminal process ends.
Jun 28, 2021
I haven't found any way to check when my terminal process ends. So, i hard coded a delay of 4 s after my terminal process starts.
PATH TO THIS FUNCTION = scripts/generate.js
The text was updated successfully, but these errors were encountered: