Skip to content

Commit a9d6de6

Browse files
feat: Add setup script for initializing project files and configurations
1 parent ed3cb2b commit a9d6de6

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"clean": "watchman watch-del-all",
1515
"clean:cache": "yarn cache clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf ios/Podfile.lock && rm -rf android/.gradle && rm -rf android/app/build && rm -rf android/build && yarn install && cd ios && pod install && cd ..",
1616
"build:release": "./script/gradle.sh && cd android && ./gradlew assembleRelease && cd .. && git checkout android/gradle.properties",
17-
"update": "sh ./script/git-submodule.sh"
17+
"submodule": "sh ./script/git-submodule.sh",
18+
"setup": "yarn submodule && sh ./script/setup.sh"
1819
},
1920
"dependencies": {
2021
"@candlefinance/faster-image": "^1.7.2",

script/setup.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Colors for output
6+
RED='\033[0;31m'
7+
GREEN='\033[0;32m'
8+
YELLOW='\033[1;33m'
9+
BLUE='\033[0;34m'
10+
NC='\033[0m' # No Color
11+
12+
# Print colored output
13+
print_status() {
14+
echo -e "${BLUE}[INFO]${NC} $1"
15+
}
16+
17+
print_success() {
18+
echo -e "${GREEN}[SUCCESS]${NC} $1"
19+
}
20+
21+
print_warning() {
22+
echo -e "${YELLOW}[WARNING]${NC} $1"
23+
}
24+
25+
print_error() {
26+
echo -e "${RED}[ERROR]${NC} $1"
27+
}
28+
29+
# Check if command exists
30+
command_exists() {
31+
command -v "$1" >/dev/null 2>&1
32+
}
33+
34+
# Copy google-services.json if it exists
35+
if [ ! -f "android/app/google-services.json" ]; then
36+
print_status "Copying google-services.json from src/InkNest-Externals root to InkNest android/app directory..."
37+
cp src/InkNest-Externals/google-services.json android/app/
38+
print_success "google-services.json copied successfully!"
39+
else
40+
print_warning "google-services.json already exists in android/app directory. Skipping copy."
41+
fi
42+
43+
# Copy GoogleService-Info.plist if it exists
44+
if [ ! -f "ios/GoogleService-Info.plist" ]; then
45+
print_status "Copying GoogleService-Info.plist from src/InkNest-Externals root to InkNest ios directory..."
46+
cp src/InkNest-Externals/GoogleService-Info.plist ios/
47+
print_success "GoogleService-Info.plist copied successfully!"
48+
else
49+
print_warning "GoogleService-Info.plist already exists in ios directory. Skipping copy."
50+
fi
51+
52+
# Copy .env file if it doesn't exist
53+
if [ ! -f ".env" ]; then
54+
print_status "Copying .env from src/InkNest-Externals root to InkNest root directory..."
55+
cp src/InkNest-Externals/.env .env
56+
print_success ".env copied successfully!"
57+
else
58+
print_warning ".env file already exists. Skipping copy."
59+
fi
60+
61+
# Copy app.json file if it doesn't exist
62+
if [ ! -f "app.json" ]; then
63+
print_status "Copying app.json from src/InkNest-Externals root to InkNest root directory..."
64+
cp src/InkNest-Externals/app.json app.json
65+
print_success "app.json copied successfully!"
66+
else
67+
print_warning "app.json file already exists. Skipping copy."
68+
fi
69+
70+
# Copy global.jks file if it doesn't exist
71+
if [ ! -f "android/app/global.jks" ]; then
72+
print_status "Copying global.jks from src/InkNest-Externals root to InkNest android/app directory..."
73+
cp src/InkNest-Externals/global.jks android/app/
74+
print_success "global.jks copied successfully!"
75+
else
76+
print_warning "global.jks already exists in android/app directory. Skipping copy."
77+
fi

0 commit comments

Comments
 (0)