23 lines
719 B
Text
23 lines
719 B
Text
|
#!/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=$(vsce_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 "Package contains"
|
||
|
npx vsce ls
|
||
|
echo "Publishing..."
|
||
|
npx vsce publish
|
||
|
else
|
||
|
echo "Package is up-to-date"
|
||
|
fi
|