airsdk / apm

AIR Package Manager
https://repository.airsdk.dev/
MIT License
61 stars 10 forks source link

Support for WSL and git bash on Windows #81

Closed jimmymjing closed 2 years ago

jimmymjing commented 2 years ago

Hello, When I run apm -version, I'm getting the warning message which: no adl in (./F:\AIRSDK/bin). I'm on Win7 and have properly setup environment variable and path. (adl command works)

I noticed that the warning message used backslash. Shouldn't it be a forward slash on windows? Thanks!

marchbold commented 2 years ago

What terminal are you using? That is a very unusual error message from windows. Looks like something from linux/macos.

You would normally expect backslashes on windows not forward slashes.

Can you elaborate on how you setup your system?

Also could you post the output from cmd /c set?

jimmymjing commented 2 years ago

Hi, I'm using Git Bash on Windows 7. The cmd command is not available.

marchbold commented 2 years ago

Okay, currently apm only supports powershell and cmd on windows. We haven't looked into git bash or WSL yet.

marchbold commented 2 years ago

So issue appears to be that you'll have set the AIR_HOME env variable to use standard windows paths i.e. F:\AIRSDK but in WSL/GIT BASH you need to use the modified filesystem paths they use. So you'll need to set it to /f/AIRSDK

You should be able to test by running apm as below:

AIR_HOME=/f/AIRSDK apm -version
jimmymjing commented 2 years ago

Wow! It works now! apm -version is not throwing error msg and simply prints the version number. Thanks so much! p.s. Do I need to do the same thing for AIR_TOOLS path?

Another question is that when I run the command adt -version, I'm getting the error bash: adt: command not found

adl command works though and prints the version as 33.1.1.686

marchbold commented 2 years ago

Hmmm okay, adt is not actually a command on windows, it's a batch file adt.bat so you may have to run that. Whereas adl is an exe. Normal windows term (powershell/cmd) will run batch files, but not sure how wsl/mingw will handle it, you'll probably have to include the extension.

adt.bat -package ...

Probably could copy the macos adt script into the windows AIRSDK/bin/ dir?

#!/bin/sh
here=$(dirname "$0")
java -Dfile.encoding=UTF-8 -jar "$here/../lib/adt.jar" "$@"

These are probably questions you should raise with Harman in the AIR SDK discussion forum though. I'm not sure if running these commands in this environment has been considered.

marchbold commented 2 years ago

Same probably is true of apm you could run apm.bat instead of the command I listed above?

jimmymjing commented 2 years ago

apm -version works. I don't need to run as apm.bat

adt.bat -version works!

marchbold commented 2 years ago

I'm just finishing up some changes to the script that should handle this path issue for you. Will include this in the next release.

jimmymjing commented 2 years ago

That's awesome!

marchbold commented 2 years ago

This should be complete, but let me know if you are still having issues.