-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·32 lines (23 loc) · 1.12 KB
/
install
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
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2021 Robin Schneider <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
set -o nounset -o pipefail -o errexit
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
if [ ! -d /mingw64 ]; then
./dotbot/bin/dotbot --base-directory "${BASEDIR}" --config-file "install.conf.yaml" "${@}"
else
# Running inside a Git Bash on legacy Windows.
# https://stackoverflow.com/questions/43650595/is-there-a-command-to-check-if-git-bash-is-opened-in-administrator-mode/58846650#58846650
if ! [[ $(sfc 2>&1 | tr -d '\0') =~ SCANNOW ]]; then
echo "You need to run this as admin otherwise symlinks cannot be created on legacy Windows." 1>&2
exit 1
fi
# From https://github.com/anishathalye/dotbot/wiki/Troubleshooting
# Is this still needed?
# export MSYS=winsymlinks:nativestrict
# Currently not fully compatible with Windows.
./dotbot/bin/dotbot --base-directory "${BASEDIR}" --config-file "install.conf.yaml" "${@}" || :
./dotbot/bin/dotbot --base-directory "${BASEDIR}" --config-file "install-legacy-windows.conf.yaml" "${@}"
fi