-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup.sh
More file actions
68 lines (53 loc) · 1.64 KB
/
setup.sh
File metadata and controls
68 lines (53 loc) · 1.64 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -exuo pipefail
OLD_PACKAGE_NAME="github.com/CodeLieutenant/GoFiber-Boilerplate"
OLD_DOCKERHUB_NAME="codeLieutenant/gofiber-boilerplate"
OLD_BINARY_NAME="GoFiber-Boilerplate"
replace_package_name() {
local new_package_name="$1"
find . -type f -exec sed -i "s|$OLD_PACKAGE_NAME|$new_package_name|g" {} +
}
replace_dockerhub_name() {
local new_dockerhub_name="$1"
find . -type f -exec sed -i "s|$OLD_DOCKERHUB_NAME|$new_dockerhub_name|g" {} +
}
replace_binary_name() {
local new_binary_name="$1"
find . -type f -exec sed -i "s|$OLD_BINARY_NAME|$new_binary_name|g" {} +
}
run_pre_commit_install() {
if command -v pre-commit &> /dev/null
then
pre-commit install
else
echo "pre-commit is not installed, skipping installation..."
fi
}
run_task_build() {
if command -v task &> /dev/null
then
task build
else
echo "task is not installed, skipping build..."
fi
}
run_task_docker_build() {
if command -v task &> /dev/null
then
task docker-build
else
echo "task is not installed, skipping docker build..."
fi
}
read -p "Enter the new package name (e.g., github.com/yourusername/yourproject): " new_package_name
read -p "Enter the new DockerHub package name (e.g., yourusername/yourproject): " new_dockerhub_name
read -p "Enter the new Binary name (e.g., yourproject): " new_binary_name
replace_package_name "$new_package_name"
replace_dockerhub_name "$new_dockerhub_name"
replace_binary_name "$new_binary_name"
run_task_build
rm -rf .git
rm -rf .github/workflows/setup-test.yml
rm -rf .github/FUNDING.yml
rm -rf setup.sh
run_pre_commit_install