File tree 3 files changed +58
-2
lines changed
3 files changed +58
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nginx-ui-app-next" ,
3
3
"type" : " module" ,
4
- "version" : " 2.0.0-rc.2 " ,
4
+ "version" : " 2.0.0-rc.3 " ,
5
5
"packageManager" :
" [email protected] +sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af" ,
6
6
"scripts" : {
7
7
"dev" : " vite --host" ,
Original file line number Diff line number Diff line change 1
- {"version" :" 2.0.0-rc.2 " ,"build_id" :2 ,"total_build" :384 }
1
+ {"version" :" 2.0.0-rc.3 " ,"build_id" :1 ,"total_build" :385 }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Version validation regex pattern
4
+ VALID_VERSION_REGEX=' ^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?$'
5
+
6
+ # Prompt for version input
7
+ while true ; do
8
+ read -p " Enter version number: " VERSION
9
+
10
+ # Remove 'v' prefix for validation
11
+ if [[ " ${VERSION# v} " =~ $VALID_VERSION_REGEX ]]; then
12
+ # Show confirmation prompt with original input
13
+ echo " You entered version: ${VERSION} "
14
+ read -p " Is this correct? [Y/n] " confirm
15
+ case ${confirm,,} in
16
+ y|yes|" " ) break ;;
17
+ n|no)
18
+ echo " Restarting version input..."
19
+ continue
20
+ ;;
21
+ * )
22
+ echo " Invalid input, please answer Y/n"
23
+ continue
24
+ ;;
25
+ esac
26
+ else
27
+ echo " Error: Invalid version format. Please use semantic versioning (e.g. 2.0.0, v2.0.1-beta.1)"
28
+ fi
29
+ done
30
+
31
+ # Cross-platform compatible sed command
32
+ if [[ " $OSTYPE " == " darwin" * ]]; then
33
+ sed -i ' ' " s/\" version\" : \" .*\" /\" version\" : \" ${VERSION# v} \" /" app/package.json
34
+ else
35
+ sed -i " s/\" version\" : \" .*\" /\" version\" : \" ${VERSION# v} \" /" app/package.json
36
+ fi
37
+ echo " Updated package.json to version ${VERSION# v} "
38
+
39
+ # Build app
40
+ echo " Building app..."
41
+ cd app && pnpm build
42
+ if [ $? -ne 0 ]; then
43
+ echo " Error: Build failed"
44
+ exit 1
45
+ fi
46
+ cd ..
47
+
48
+ # Run go generate
49
+ echo " Generating Go code..."
50
+ go generate ./...
51
+ if [ $? -ne 0 ]; then
52
+ echo " Error: go generate failed"
53
+ exit 1
54
+ fi
55
+
56
+ echo " Version update and generation completed successfully"
You can’t perform that action at this time.
0 commit comments