-
Notifications
You must be signed in to change notification settings - Fork 90
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
Added std lib files into installer #640
base: staging
Are you sure you want to change the base?
Conversation
2 more things @Ph0enixKM I'd like to brirng in your account. I think the project needs a rename from
Usage: amber [OPTIONS] [INPUT] [ARGS]... [COMMAND]
Commands:
eval Execute Amber code fragment
run Execute Amber script
check Check Amber script for errors
build Compile Amber script to Bash
docs Generate Amber script documentation
completion Generate Bash completion script
help Print this message or the help of the given subcommand(s)
Arguments:
[INPUT] Input filename ('-' to read from stdin)
[ARGS]... Arguments passed to Amber script
Options:
--no-proc <NO_PROC> Disable a postprocessor
Available postprocessors: 'shfmt', 'bshchk'
To select multiple, pass multiple times with different values
Argument also supports a wilcard match, like "*" or "s*mt"
-h, --help Print help
-V, --version Print version I initially thought of alias, but due to this copyright, I am not sure we'll be able to get an alias to amber. |
@soumyaDghosh This project that you shared is not being maintained 7 years now. It seems that it's something that they abandoned long time ago. I think that there is no problem with us sticking to the name "amber". Quite frankly anyone could name their project "amber". But unless this name is not widely recognized in the shell scripting environment, I'd say it's still a good one. You've mistaken copyright for trademark, @soumyaDghosh |
How can we create an |
You just create a forum post requesting an alias, similar to this Users can anyways create local aliases,
|
I've decided that there are too many installer variations. It needs to be unified. Cargo dist is my pick as it compiles for macos, linux and windows on all architectures and offers easy updates. Packaging is also simple. I added config just for shell installer but homebrew is also an option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this file deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I said before, I think that having many different installers is going to be cumbersome for both users and devs. They won't know what's the correct way to install Amber and uninstall it. There can be a situation where one persons has installed amber in three different ways on his/hers machine. One install script to rule them all is the best way to go about it (I think)
@KrosFire btw since Amber is already installed, can we write uninstaller in Amber itself? |
You're right |
I love this uninstall sentence "see you later 🐊" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't get it. is there some kind of mistake with committing wrong files? why are so many things deleted? how are any of those deletions relevant?
please explain why you had to get rid of all those files, and how will it help you with putting stdlib into the installer. especially since you deleted the installer in question
i strongly suggest that we discuss the change itself in #643 , and reserve this space for code review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving comments only, as I do not feel qualified to review installer changes.
permissions: | ||
contents: write | ||
"contents": "write" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unnecessary to add quotes around either name or value here. There may be specific reasons why it's necessary, but YAML itself has no such requirement.
plan: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-20.04" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to target a specific version of Ubuntu, especially such an old one? (two LTS releases ago!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was generated by cargo dist
. I checked their issue on updating the runner to the LTS latest, but their reasoning was to further improve compatibility. I don't think that we'd benefit from it. I'd advise to go away from cargo dist
and build our own CI with cargo cross
(a cross platform compiler) the way we do for linux-arm
right here
@@ -0,0 +1,12 @@ | |||
|
|||
let amber_path = $command -v amber$ failed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please:
- Don't leave blank lines at top of file.
- Consider adding a shebang line and making the file executable.
- Consider moving Amber code to a
main
block. - Add inner spaces in commands
$ ... $
, as$command
looks like a Bash variable. - Rename
amber_installation_dir
to something shorter.
#!/usr/bin/env amber
main {
let amber_path = $ command -v amber $ failed {
echo "Amber is not in $PATH."
exit 1
}
let amber_dir = trust $ dirname "\$(readlink -f {amber_path})" $
echo "Uninstalling Amber..."
trust $ rm -f {amber_path} $
trust $ rm -rf {amber_dir} $
echo "Amber uninstalled. See you later, 🐊"
}
use std::{env, fs, path::PathBuf}; | ||
|
||
#[cfg(not(debug_assertions))] | ||
fn get_install_dir() -> PathBuf { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why you need different versions of this function for debug and release builds. Consider picking one and using it for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please move private functions below public function resolve()
, which they support.
Hello there,
For the LSP I need std lib files on the client machine, and not as a part of the compiler. I didn't touch Nix files as it is scientifically proven fact that it is black magic.
I think there can be a lot of edge cases, so any tests will be most welcome.
Enjoy.