diff options
author | Alexander <a.kiryukhin@vk.team> | 2024-10-10 17:35:30 +0300 |
---|---|---|
committer | Alexander <a.kiryukhin@vk.team> | 2024-10-10 17:35:30 +0300 |
commit | 79277335465f3a59460844bf322b5b1b07827a78 (patch) | |
tree | 2326523bd51ce7678c945b6eece8375beb903b53 /bin/ovsx_publish_package_when_outdated |
initial
Diffstat (limited to 'bin/ovsx_publish_package_when_outdated')
-rwxr-xr-x | bin/ovsx_publish_package_when_outdated | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/ovsx_publish_package_when_outdated b/bin/ovsx_publish_package_when_outdated new file mode 100755 index 0000000..68280ba --- /dev/null +++ b/bin/ovsx_publish_package_when_outdated @@ -0,0 +1,20 @@ +#!/usr/bin/env sh +set -e + +PACKAGE_LOCAL_VERSION=$(node --print "require('./package.json').version") +PUBLISHER=$(node --print "require('./package.json').publisher") +PACKAGE_NAME=$(node --print "require('./package.json').name") + +PACKAGE_LAST_PUBLISHED_VERSION=$(ovsx_package_last_published_version "${PUBLISHER}" "${PACKAGE_NAME}") + +echo "${PUBLISHER}.${PACKAGE_NAME}" +echo "Package local version: ${PACKAGE_LOCAL_VERSION}" +echo "Package last published version: ${PACKAGE_LAST_PUBLISHED_VERSION}" + +if [ "${PACKAGE_LAST_PUBLISHED_VERSION}" != "${PACKAGE_LOCAL_VERSION}" ]; then + echo "Package is outdated" + echo "Publishing..." + npx ovsx publish +else + echo "Package is up-to-date" +fi |