Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Call open in new window" only when the terminal process ends. #3

Open
iamAbhishekkumar opened this issue Apr 11, 2021 · 0 comments
Open
Labels
bug Something isn't working hackodex hackodex-iter

Comments

@iamAbhishekkumar
Copy link
Owner

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

@iamAbhishekkumar iamAbhishekkumar added bug Something isn't working help wanted Extra attention is needed labels Apr 11, 2021
@iamAbhishekkumar 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
@iamAbhishekkumar iamAbhishekkumar added hackodex hackodex-iter and removed help wanted Extra attention is needed labels Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hackodex hackodex-iter
Projects
None yet
Development

No branches or pull requests

1 participant