Skip to content

Instantly share code, notes, and snippets.

@3m1n3nc3
Last active April 26, 2024 08:24
Show Gist options
  • Save 3m1n3nc3/56099baf757e973b20b9bdb8a8bd9757 to your computer and use it in GitHub Desktop.
Save 3m1n3nc3/56099baf757e973b20b9bdb8a8bd9757 to your computer and use it in GitHub Desktop.
Installs node, Quasar and build your project in preparation for Xcode Cloud *Workflow*
#!/bin/bash
# ci_post_clone.sh
# App
#
# Created by xXx on 26/04/2024.
#
get_abs_filename() {
# $1 : relative filename
echo "$(
cd "$(dirname -- "$1")" >/dev/null
pwd -P
)/$(basename -- "$1")"
}
SCRIPTPATH="$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
base_path=$(get_abs_filename "${SCRIPTPATH}/../../../../")
capacitor_path=$(get_abs_filename "${SCRIPTPATH}/../../../../src-capacitor")
# installs NVM (Node Version Manager)
echo "Installing nvm"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash 1>/dev/null
# Reload the shell
source ${HOME}/.nvm
source ~/.zshrc
echo "Installing nvm completed"
# download and install Node.js
echo "Installing nodejs"
nvm install 22 1>/dev/null
# Reload the shell again
source ~/.zshrc
echo "Installing nodejs completed"
# install Yarn
echo "Installing yarn"
npm install -g yarn
# Reload the shell again
source ~/.zshrc
echo "Installing yarn completed"
# Go to root dir
cd $base_path
# run yarn
echo "Installing dependencies"
yarn 1>/dev/null
echo "Installing dependencies completed"
# build app
echo "Running quasar build -m capacitor -T ios"
yarn quasar build -m capacitor -T ios --ide 1>/dev/null
# ./node_modules/.bin/quasar build -m capacitor -T ios --ide 1>/dev/null
echo "Installation Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment