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

Handle OS compatibility (Linux and Windows for now) #22

Open
Hellfar opened this issue Jan 2, 2019 · 5 comments
Open

Handle OS compatibility (Linux and Windows for now) #22

Hellfar opened this issue Jan 2, 2019 · 5 comments
Labels

Comments

@Hellfar
Copy link
Contributor

Hellfar commented Jan 2, 2019

Right now we are only compatible with Linux.
It is essential that we also approach Windows.

I will need help to test the same features on Windows (different versions) and Linux.

@naturallymitchell
Copy link
Member

android too

@Hellfar
Copy link
Contributor Author

Hellfar commented Jan 3, 2019

I propose:

Linux

HOME = os.getenv("HOME")
REPOSITORY_HOME = HOME .. "/.mp/packages/"
MP_HOME = "/usr/share/mp/"
INSTALL_HOME = "/usr/share/"
BIN_HOME = "/usr/bin/"

DEFAULT_PATH           = "./"
DEFAULT_SAVE_DIRECTORY = ".mp/"

Windows

REPOSITORY_HOME = "%AppData%/Roaming/.mp/packages/"
MP_HOME = "%ProgramFiles%/mp/"
INSTALL_HOME = MP_HOME
BIN_HOME = MP_HOME

DEFAULT_PATH           = "./"
DEFAULT_SAVE_DIRECTORY = ".mp/"

(I will take care of the separators).

Android

Open to suggestions.

@sh-zam
Copy link
Collaborator

sh-zam commented Jan 3, 2019

We are using Cmder for Windows, so we could do the way torchbear does it: https://github.com/foundpatterns/torchbear/blob/master/install.sh#L144

Similar with Android.

@dariusc93
Copy link

For windows, it would be best to make sure that any variables youre using will work (eg %AppData%, etc) within lua. Using os.getenv may work but that is something that should be up for testing. Like @sh-zam mentioned we do use cmder and there is a environment variable used to detect if cmder is being used which. It probably would be wise to store any packages in AppData or probably have them stored in the "home" directory (since cmder do have a $HOME variable which points to the user profile directory in windows). For android, it technically can be the same as what is being done with linux but the MP_HOME, INSTALL_HOME, and BIN_HOME would have to be changed to fit the path that is used on termux.

On a side note: It would be best to use /usr/local over /usr

@Hellfar
Copy link
Contributor Author

Hellfar commented Jan 17, 2019

How was it handled in the end ?

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

No branches or pull requests

4 participants