mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	Fixed publish script
This commit is contained in:
		@@ -5,6 +5,7 @@ then
 | 
				
			|||||||
    echo "\$NPM_TOKEN is not set"
 | 
					    echo "\$NPM_TOKEN is not set"
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
 | 
					    cd dist
 | 
				
			||||||
    # Need to replace "_" with "-" as GitLab CI won't accept secret vars with "-"
 | 
					    # Need to replace "_" with "-" as GitLab CI won't accept secret vars with "-"
 | 
				
			||||||
    echo "//registry.npmjs.org/:_authToken=$(echo "$NPM_TOKEN" | tr _ -)" > .npmrc
 | 
					    echo "//registry.npmjs.org/:_authToken=$(echo "$NPM_TOKEN" | tr _ -)" > .npmrc
 | 
				
			||||||
    echo "unsafe-perm = true" >> ~/.npmrc
 | 
					    echo "unsafe-perm = true" >> ~/.npmrc
 | 
				
			||||||
@@ -12,10 +13,10 @@ else
 | 
				
			|||||||
    then
 | 
					    then
 | 
				
			||||||
        BETA_VERSION=$(npx -c 'echo "$npm_package_version"')-beta.$CI_COMMIT_SHORT_SHA
 | 
					        BETA_VERSION=$(npx -c 'echo "$npm_package_version"')-beta.$CI_COMMIT_SHORT_SHA
 | 
				
			||||||
        npm version "$BETA_VERSION" --git-tag-version false
 | 
					        npm version "$BETA_VERSION" --git-tag-version false
 | 
				
			||||||
        cd dist && npm publish --tag beta
 | 
					        npm publish --tag beta
 | 
				
			||||||
    elif test "$1" = "latest"
 | 
					    elif test "$1" = "latest"
 | 
				
			||||||
    then
 | 
					    then
 | 
				
			||||||
        cd dist && npm publish
 | 
					        npm publish
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        echo "Usage: publish.sh [ beta | latest ]"
 | 
					        echo "Usage: publish.sh [ beta | latest ]"
 | 
				
			||||||
        exit 1
 | 
					        exit 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user