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

Add posibility to change the current working directory/folder #56

Open
lukaszm89 opened this issue Feb 27, 2017 · 0 comments
Open

Add posibility to change the current working directory/folder #56

lukaszm89 opened this issue Feb 27, 2017 · 0 comments

Comments

@lukaszm89
Copy link

When creating bat and sh files with assemble there should be possibility to force script to set up working directory before java execution. The problem here is that when executing bat file from different directory then app/bin application base path is set to that other directory rather than app directory. An example:
When we create new File(".") in our application and print its absolute path
D:\test_app> bin\test_app.bin -> D:\test_app\.
but when we try to run the same bat file but from different current directory:
D:\other_dir\my_stuff> D:\test_app\bintest_app.bin -> D:\other_dir\my_stuff\.

This can be done with: pushd %BASEDIR% before calling java and then popd and the end of the script to revert this change. This will ensure that app always has set correct working directory and for example logging libraries that are using relative paths will log to correct directory inside our app folder and not inside current user directory.

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

No branches or pull requests

1 participant