-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·34 lines (28 loc) · 932 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·34 lines (28 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# install.sh — One-line installer for @mostajs/orm-cli
# Usage : curl -fsSL https://raw.githubusercontent.com/apolocine/mosta-orm-cli/main/install.sh | bash
# Author: Dr Hamid MADANI drmdh@msn.com
set -euo pipefail
BASE_URL="https://raw.githubusercontent.com/apolocine/mosta-orm-cli/main/bin"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
NEEDS_SUDO=0
if [[ ! -w "$INSTALL_DIR" ]]; then
NEEDS_SUDO=1
fi
echo "@mostajs/orm-cli — installer"
echo " install dir : $INSTALL_DIR"
[[ $NEEDS_SUDO -eq 1 ]] && echo " (needs sudo to write there)"
do_install() {
local sudo_cmd=""
[[ $NEEDS_SUDO -eq 1 ]] && sudo_cmd="sudo"
curl -fsSL "$BASE_URL/mostajs.sh" -o /tmp/mostajs.sh.$$
chmod +x /tmp/mostajs.sh.$$
$sudo_cmd mv /tmp/mostajs.sh.$$ "$INSTALL_DIR/mostajs"
echo
echo "✓ Installed : $INSTALL_DIR/mostajs"
echo
echo "Try it :"
echo " cd your/project"
echo " mostajs"
}
do_install