open source is social v-it.org
1#!/bin/sh
2set -e
3
4SELF="solpbc/vit"
5
6command_exists() {
7 command -v "$1" >/dev/null 2>&1
8}
9
10echo "installing vit from source ($SELF)..."
11
12if ! command_exists git; then
13 echo "error: git is required. install git and try again."
14 exit 1
15fi
16
17if ! command_exists bun; then
18 echo "bun not found, installing..."
19 curl -fsSL https://bun.sh/install | bash
20 export BUN_INSTALL="$HOME/.bun"
21 export PATH="$BUN_INSTALL/bin:$PATH"
22fi
23
24DIR_NAME=$(echo "$SELF" | sed 's|.*/||')
25if [ -d "$DIR_NAME" ]; then
26 echo "$DIR_NAME/ already exists, skipping clone"
27else
28 if command_exists gh; then
29 gh repo clone "$SELF" "$DIR_NAME"
30 else
31 git clone "https://github.com/$SELF.git" "$DIR_NAME"
32 fi
33fi
34
35cd "$DIR_NAME"
36
37bun install
38node bin/vit.js link
39
40echo ""
41echo "vit installed from source"
42echo "run: cd $DIR_NAME"