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

Provide a Way to Change the Current Working Directory in Ballerina #7548

Open
ThisaruGuruge opened this issue Jan 31, 2025 · 2 comments
Open

Comments

@ThisaruGuruge
Copy link
Member

Current Limitation

Although Ballerina is intended to be an Integration Language, it can be handy when it comes to scripting, especially automation works.

I've recently wanted to write a script to do some change in multiple repos, and send PRs to the respective repos. I wanted to do this using Ballerina, but the existing ballerina/os package has some limitations when doing so.

The main issue was the inability to change the current working directory. Our existing os:exec function does not have a way to change the working directory. Of course we can hack it to provide cd /path/to/working/dir; <MY_COMAND>, but this isn't an ideal solution.

I've found a previous discussion on the os:exec function, where it mentions that the first iteration will not include the working directory path, but without it, the exec function is more or less useless. Therefore i'd propose to implement the functionality to change the current working directory.

Suggested Improvement

There are two options to do this;

  • Change the current working directory using a separate method
  • Provide a way to pass the working directory to os:exec function

Version

No response

@randilt
Copy link

randilt commented Feb 2, 2025

I would like to work on this issue @ThisaruGuruge

@ThisaruGuruge
Copy link
Member Author

I would like to work on this issue @ThisaruGuruge

Thank you @randilt. You can start working on this. Please let us know if you need any help.

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

No branches or pull requests

2 participants