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

Platform compatibility #23

Closed
1 task
caffeine-addictt opened this issue Apr 27, 2024 · 14 comments · Fixed by #28
Closed
1 task

Platform compatibility #23

caffeine-addictt opened this issue Apr 27, 2024 · 14 comments · Fixed by #28
Assignees
Labels
help wanted Help wanted Os: Linux Is Linux-specific Os: Mac Is Mac-specific Os: Windows Is Windows-specific

Comments

@caffeine-addictt
Copy link
Owner

caffeine-addictt commented Apr 27, 2024

The setup script was developed for and on Linux.

Might not be compatible with other OSes. PRs welcome.

Spec

  • Porting bash to node
@caffeine-addictt caffeine-addictt added help wanted Help wanted Os: Windows Is Windows-specific Os: Mac Is Mac-specific Os: Linux Is Linux-specific labels Apr 27, 2024
@caffeine-addictt caffeine-addictt self-assigned this Apr 27, 2024
@caffeine-addictt caffeine-addictt pinned this issue Apr 27, 2024
@LyubomirT
Copy link
Contributor

It's good to see you again @caffeine-addictt! I'm not a master of Bash, but may I try to optimize it for Windows (Sadly I don't have a Mac so Windows is the best thing I can do for now)?

@caffeine-addictt
Copy link
Owner Author

Sure thing @LyubomirT :>

However as setup.sh is running UNIX commands, I doubt it will run on cmd or powershell, it should run fine on WSL though. Also considering windows uses \ for path and UNIX uses / for path, there may be some conflicts. It might be best to make a separate win_setup.sh script.

What do you think?

@LyubomirT
Copy link
Contributor

Perhaps that'll be the best course of action (and the most popular one among developers, too), I think it'd be a great way to do that. Although we might want to create something that does the same but is written in an entirely different language (for example, C#/Python3/Node.js), because languages like those often support many platforms from the start.

@caffeine-addictt
Copy link
Owner Author

I agree.

Since formatting is already done with node, it may be best to go with it.
Although the issue now lies in getting js/ts to delete itself.

I'll do some research in the meantime.

@caffeine-addictt
Copy link
Owner Author

I guess we could still have shell files that run js and handle pre installation and post cleanup.

template/
|_ scripts/
|  |_ main.ts
|_ setup.sh
|_ ...

Something like:

# Check for npm binary
# Invoke npm i

# Run js/ts

# Delete js/ts
# Delete artifacts (node_modules, package.json, etc.)
# Delete itself

Likely would need:

  • .sh (bash) UNIX
  • .bat (cmd) Windows
  • .ps (invokes cmd with .bat)

@LyubomirT
Copy link
Contributor

LyubomirT commented Apr 28, 2024

I guess we could still have shell files that run js and handle pre installation and post cleanup.

...

Something like:

...

Likely would need:

  • .sh (bash) UNIX
  • .bat (cmd) Windows
  • .ps (invokes cmd with .bat)

Good idea! I think we could also skip the artifacts / npm part completely (will require less setup from the side of the user) if we manage to write the setup script with 0 dependencies and put it in a GitHub repository or any other accessible source. (just my personal thought, NPM will work well too)

@caffeine-addictt
Copy link
Owner Author

In that case, how about having users copy scripts directly to the CLI from the README?

# README

# Linux
chmod +x ./setup.sh && ./setup.sh && rm -rf artifacts

@LyubomirT
Copy link
Contributor

In that case, how about having users copy scripts directly to the CLI from the README?

# README

# Linux
chmod +x ./setup.sh && ./setup.sh && rm -rf artifacts

It could be a bit daunting in my opinion, people prefer when everything's interactive nowadays. Plus, I doubt it'll take long to download a 500B file and go through some steps.

@caffeine-addictt
Copy link
Owner Author

True.
What do you have in mind for implementing it?

@LyubomirT
Copy link
Contributor

True. What do you have in mind for implementing it?

Not forcing anything, but perhaps we could simply port the already-implemented code from Bash to JS, with platform-specific conditions to keep everything in a single script?

@caffeine-addictt
Copy link
Owner Author

Sounds like a plan.

@caffeine-addictt caffeine-addictt added this to the v1.9.0 milestone Apr 28, 2024
@LyubomirT
Copy link
Contributor

Sounds like a plan.

Okay then! Starting to work on this issue right away.

@caffeine-addictt
Copy link
Owner Author

Sounds like a plan.

Okay then! Starting to work on this issue right away.

Running with typescript?

@LyubomirT
Copy link
Contributor

LyubomirT commented Apr 28, 2024

Sounds like a plan.

Okay then! Starting to work on this issue right away.

Running with typescript?

Perhaps basic Node will do better in this case, as we're aiming for a broad audience, and Node.js is easier to set up for most users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Help wanted Os: Linux Is Linux-specific Os: Mac Is Mac-specific Os: Windows Is Windows-specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants