Skip to content

added condition to the setup #1

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (shouldProceed === 'y' || shouldProceed === 'yes') {
await $`sudo apt upgrade`
await sleep(1000);
console.log('Now, we are installing the packages:');
await $`zx https://raw.githubusercontent.com/foyzulkarim/linux-playbook-javascript/main/script.mjs`;
await $`zx script.mjs`;
await sleep(1000);
} else {
console.log(`You can't proceed.`);
Expand Down
21 changes: 14 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/bin/bash
# My first script
echo "Setting up nvm!"
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
echo "This script will setup node in this machine:"
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install node
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --lts
npm i -g npm@latest
npm install -g zx
source ~/.bashrc
zx -v
zx https://raw.githubusercontent.com/foyzulkarim/linux-playbook-javascript/main/index.mjs

echo "Do you want to install other packages using index.mjs?"
read -p "y/n: " answer
if [ "$answer" = "y" ]; then
zx './index.mjs'
else
echo "Ok, bye!"

# zx https://raw.githubusercontent.com/foyzulkarim/linux-playbook-javascript/main/index.mjs