File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,13 @@ MAJOR_MINOR=$(echo "$CURRENT" | sed 's/\.[0-9]*$//')
2929BUILD=$( echo " $CURRENT " | sed ' s/.*\.//' )
3030
3131if [ -n " $1 " ]; then
32- NEW_VERSION=" $1 .$BUILD "
32+ # If the argument already contains at least two dots (e.g. 1.2.3), use it as-is
33+ DOT_COUNT=$( echo " $1 " | tr -cd ' .' | wc -c | tr -d ' ' )
34+ if [ " $DOT_COUNT " -ge 2 ]; then
35+ NEW_VERSION=" $1 "
36+ else
37+ NEW_VERSION=" $1 .$BUILD "
38+ fi
3339else
3440 NEW_VERSION=" $MAJOR_MINOR .$(( BUILD + 1 )) "
3541fi
@@ -40,12 +46,9 @@ echo "π Updating version to $NEW_VERSION..."
4046echo " π Updating package.json..."
4147sed -i ' ' " s/\" version\" : \" [^\" ]*\" /\" version\" : \" $NEW_VERSION \" /" package.json
4248
43- # Regenerate src/version.ts from package.json
44- echo " π Regenerating src/version.ts..."
45- cat > src/version.ts << EOF
46- // Auto-generated from package.json β do not edit manually
47- export const VERSION = '$NEW_VERSION ';
48- EOF
49+ # Update VERSION in src/version.ts (preserve license header)
50+ echo " π Updating src/version.ts..."
51+ sed -i ' ' " s/export const VERSION = '[^']*';/export const VERSION = '$NEW_VERSION ';/" src/version.ts
4952
5053echo " "
5154echo " β
Version updated to $NEW_VERSION "
Original file line number Diff line number Diff line change 11{
22 "name" : " sonarqube-cli" ,
33 "type" : " module" ,
4- "version" : " 0.1.142 " ,
4+ "version" : " 0.1.0 " ,
55 "description" : " SonarQube CLI" ,
66
77 "bin" : {
Original file line number Diff line number Diff line change 1919 */
2020
2121// Auto-generated from package.json β do not edit manually
22- export const VERSION = '0.1.142 ' ;
22+ export const VERSION = '0.1.0 ' ;
You canβt perform that action at this time.
0 commit comments