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

improve execution step #123

Merged
merged 1 commit into from
Jun 17, 2023
Merged

improve execution step #123

merged 1 commit into from
Jun 17, 2023

Conversation

AntonOsika
Copy link
Owner

Fix #103

@AntonOsika AntonOsika merged commit cfb116b into main Jun 17, 2023
subprocess.run(command, shell=True)

# Run the subprocess in dbs.workspace.path
subprocess.run('bash run.sh', shell=True, cwd=dbs.workspace.path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @AntonOsika

I think I am missing something here, are we forcing the creation of a run.sh file somewhere?

Copy link
Contributor

@jebarpg jebarpg Jun 17, 2023

Choose a reason for hiding this comment

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

Might need an environment flag to choose which shell to use for this. something like
@patillacode @AntonOsika

import subprocess
import psutil
import os
#https://github.com/giampaolo/psutil
p = psutil.Process(os.getppid())
env = p.environ()
print(env)
if 'COMSPEC' in env:
    subprocess.run('cmd run.bat', shell=True, cwd=dbs.workspace.path)
if 'SHELL' in env:
    subprocess.run(f'{env['SHELL']} run.sh', shell=True, cwd=dbs.workspace.path) #{env['SHELL']}will return the shell like this '/bin/bash'

Choose a reason for hiding this comment

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

Can I change this in my own build? Super unfamiliar with github and the like, but I'm trying to run gp-engineer through vscode terminal and conda env.

@patillacode
Copy link
Collaborator

With your permission @AntonOsika
I am removing merged branches to avoid cluttering.

@patillacode patillacode deleted the ao/execute-step branch June 18, 2023 14:32
@AntonOsika
Copy link
Owner Author

Great. I'm used to that happening automatically 🙏 @patillacode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants