-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
37 lines (30 loc) · 849 Bytes
/
setup.sh
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
#!/bin/bash
set -e
os=$(uname)
dir_name=".ntui"
config_file="config.toml"
home_dir=""
if [ "$os" = "Darwin" ]; then
home_dir="$HOME"/"$dir_name"
if [ ! -f "$home_dir"/"$config_file" ]; then
mkdir -p "$home_dir"
touch "$home_dir"/"$config_file"
echo $(config_file) > "$home_dir"/"$config_file"
fi
elif [ "$os" = "Linux" ]; then
home_dir="$HOME"/"$dir_name"
if [ ! -f "$home_dir"/"$config_file" ]; then
mkdir -p "$home_dir"
touch "$home_dir"/"$config_file"
echo $(config_file) > "$home_dir"/"$config_file"
fi
elif [ "$os" = "MINGW64_NT-10.0" ]; then
home_dir="$HOME"\\"$dir_name"
if [ ! -f "$home_dir"\\"$config_file" ]; then
mkdir -p "$home_dir"
touch "$home_dir"\\"$config_file"
fi
else
echo "Unsupported operating system."
exit 1
fi