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

Option to use env variable for current directory (pwd) in messages #322

Open
martindsouza opened this issue Dec 12, 2019 · 0 comments
Open
Assignees
Milestone

Comments

@martindsouza
Copy link
Member

In the new Nitro 5 init menus, it auto detects the folder I'm in. This shows up both when determining the libraryName as well as when running apex-nitro launch:

(see all references to /data/)

APEX Nitro
is building /data/src ...
=> bundling files

./src/main.js → ./build/demo.js...
created ./build/demo.js in 3.9s

./src/main.js → ./build/demo.min.js...
created ./build/demo.min.js in 5.4s

...Done!
...Now launching!
Open up your favorite code editor to /data/src
Any change you make is synchronized to your APEX app in real time.

At first glance there isn't anything wrong with this, however when running in a Docker context (#231), the Docker container can "only see itself" and is unaware of what the host machine (i.e. laptop) current directory is.

To people that use Docker a lot this isn't too confusing but can get people that may not realized that, in my example, /Users/giffy/OneDrive/Documents/GitHub/oraopensource/apex-nitro/docker/test-proj is really being mapped to /data on the Docker container.

To get around this issue I propose the following: Have an environmental variable (lets say APEX_NITRO_PWD_PATH) If this is has a value, use its value rather than pwd on the current system for any "vanity" functions (i.e. display messages but not hard reference points). When running Docker (via setting the alias) we'll run it as:

alias apex-nitro="docker run -it --rm \
  -e APEX_NITRO_PWD_PATH=`pwd` \
  -v `pwd`:/data \
  -p 4000:4000 \
  oraopensource/apex-nitro:latest"

Given that we'll provide the alias for users to run they won't have to think about this additional env variable. If it's missing the worst that will happen is that apex-nitro will reference its local pwd path.

@martindsouza martindsouza changed the title Option to use env variable for current directory (pwd) Option to use env variable for current directory (pwd) in messages Dec 12, 2019
@vincentmorneau vincentmorneau added this to the v5.0.0 milestone Dec 13, 2019
@vincentmorneau vincentmorneau removed their assignment Aug 18, 2020
@vincentmorneau vincentmorneau modified the milestones: v5.0.0, v6.0.0 Aug 18, 2020
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