-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·49 lines (36 loc) · 1.04 KB
/
install.sh
File metadata and controls
executable file
·49 lines (36 loc) · 1.04 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Stop when errors
set -euo pipefail
MAKEFILES_PREFIX=".modules"
MAKEFILECORE_FILE="$MAKEFILES_PREFIX/core.mk"
MAKEFILE_CORE_URL=https://raw.githubusercontent.com/Captive-Studio/makefile-core/main/core.mk
INCLUDE_TEMPLATE="include $MAKEFILECORE_FILE"
# Download core module
mkdir -p $MAKEFILES_PREFIX
curl -fsSL -o "$MAKEFILECORE_FILE" "$MAKEFILE_CORE_URL"
# Update Makefile
touch Makefile
if ! grep "$INCLUDE_TEMPLATE" Makefile > /dev/null; then
MAKEFILE_CONTENT=$(cat Makefile)
cat << EOF > Makefile
# Include custom variables
-include config.mk
# Include custom local variables
# ⚠️ This file should never be versioned
-include local.mk
# Include Core
$INCLUDE_TEMPLATE
$MAKEFILE_CONTENT
EOF
fi
if [[ ! -f config.mk ]]; then
cat << EOF > config.mk
# Makefile configuration
# Upstream for core.mk used by make self-update
export MAKEFILE_CORE_URL := $MAKEFILE_CORE_URL
# Project name (ex: vesta)
# export CI_PROJECT_NAME ?= <TODO>
# Project namespace (ex: Captive-Studio)
# export CI_PROJECT_NAMESPACE ?= <TODO>
EOF
fi