#!/bin/sh

set -e

CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA:-local}

for dir in deadlock-plugins/*/; do
    echo "Building $dir"
    cd $dir
    CURRENT_PLUGIN_DIR=$(basename "$PWD")
    npm install
    npm run vsce
    cp *.vsix ../../plugins/$CURRENT_PLUGIN_DIR-$CI_COMMIT_SHORT_SHA.vsix
    cd -
done
