-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add script #1
base: main
Are you sure you want to change the base?
Add script #1
Conversation
- check plugin instead of checking by tool name
fi | ||
} | ||
|
||
assert_not_installed_outside_asdf() { |
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 function's body seems overcomplicated for what it is supposed to do.
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.
Are you sure it is? Do you have any simplifications in mind?
I think the sh syntax might make it appear so, but we have pretty simple logic there IMO
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.
For starters you can try to hold a list of tools, cmds and instructions in variables you iterate over. That way you could simplify the outer for
loop and get rid of the case
conditional. Like this:
local installed_tools=""
local tools=("scarb" "starknet-foundry")
local tool_cmds=("scarb" "snforge sncast")
local uninstall_instructions=("$SCARB_UNINSTALL_INSTRUCTIONS" "$STARKNET_FOUNDRY_UNINSTALL_INSTRUCTIONS")
for i in "${!tools[@]}"; do
local tool=${tools[i]}
local cmds=${tool_cmds[i]}
local uninst_instructions=${uninstall_instructions[i]}
if ! check_asdf_plugin_installed "$tool"; then
(.....)
not sure you can do something about nested if-for-if, probably not much
When run with
I get
But I cannot choose "yes" - it goes straight to the second message. |
curl -sS --fail "https://api.github.com/repos/${_repo}/releases/latest" | awk -F'"' '/"tag_name"/ {print $4}' | ||
} | ||
|
||
install_universal_sierra_compiler() { |
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.
Not sure what I am doing wrong, but USC does not seem to be installed? 🤔
root@fa7d42801b6b:/# bash install.sh
Location of scarb plugin: /root/.asdf/plugins/scarb
Updating scarb to main
Already on 'main'
Your branch is up to date with 'origin/main'.
scarb 2.9.2 is already installed
Location of starknet-foundry plugin: /root/.asdf/plugins/starknet-foundry
Updating starknet-foundry to main
Already on 'main'
Your branch is up to date with 'origin/main'.
redirect url: https://github.com/foundry-rs/starknet-foundry/releases/tag/v0.36.0
starknet-foundry 0.36.0 is already installed
redirect url: https://github.com/foundry-rs/starknet-foundry/releases/tag/v0.36.0
starknetup: Installation complete. Run 'source /root/.bashrc' or start a new terminal session to use the installed tools.
root@fa7d42801b6b:/# source /root/.bashrc
root@fa7d42801b6b:/# universal-sierra-compiler
bash: universal-sierra-compiler: command not found
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.
Might be caused by:
root@fa7d42801b6b:/# curl -sSL --fail https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh
Downloading and extracting universal-sierra-compiler-v2.3.0-aarch64-unknown-linux-gnu...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3314k 100 3314k 0 0 3006k 0 0:00:01 0:00:01 --:--:-- 11.3M
universal-sierra-compiler: could not detect shell, manually add /root/.local/bin to your PATH.
But the error msg is not shown to the user
Closes software-mansion/scarb#1821