|
4 | 4 | # docs: https://code.visualstudio.com/api/working-with-extensions/publishing-extension |
5 | 5 | # run: sh scripts/publish.sh {VSCE_KEY} |
6 | 6 |
|
7 | | -VSCE_KEY=$1 |
8 | 7 | PACKAGE_VERSION=$(grep'version' package.json \ |
9 | 8 | | cut -d'"' -f4) |
10 | 9 | RELEASES_FOLDER=releases |
11 | 10 | OUTPUT_FILE=coderoad-$PACKAGE_VERSION.vsix |
12 | 11 | RAW_PATH=https://github.com/coderoad/coderoad-vscode/blob/master |
13 | 12 |
|
| 13 | +if [[-z"$VSCE_KEY" ]]&& [[-z"$OVSX_KEY" ]];then |
| 14 | +echo"VSCE_KEY or OVSX_KEY is required" |
| 15 | +exit 1; |
| 16 | +fi |
| 17 | + |
14 | 18 | # comment out until confident in testing process |
15 | 19 | git tag -a v$PACKAGE_VERSION -m"Releasing version v$PACKAGE_VERSION" |
16 | 20 | git push origin v$PACKAGE_VERSION |
17 | 21 |
|
18 | | -# send to VSCode Marketplace via |
19 | | -vsce publish -p$VSCE_KEY --packagePath ./$RELEASES_FOLDER/$OUTPUT_FILE --baseContentUrl$RAW_PATH --baseImagesUrl$RAW_PATH |
| 22 | +# send to VSCode Marketplace |
| 23 | +if! [[-z"$VSCE_KEY" ]];then |
| 24 | +echo"publishing to vscode marketplace..." |
| 25 | + npx vsce publish -p$VSCE_KEY --packagePath ./$RELEASES_FOLDER/$OUTPUT_FILE --baseContentUrl$RAW_PATH --baseImagesUrl$RAW_PATH |
| 26 | +fi |
| 27 | +# send to Open-VSX Marketplace (https://github.com/eclipse/openvsx/wiki/Publishing-Extensions) |
| 28 | +if! [[-z"$OVSX_KEY" ]];then |
| 29 | +echo"publishing to open-vsx marketplace..." |
| 30 | + npx ovsx publish -p$OVSX_KEY ./$RELEASES_FOLDER/$OUTPUT_FILE --baseContentUrl$RAW_PATH --baseImagesUrl$RAW_PATH" |
| 31 | +fi |