From e1b2dab902c3bddc584a68cba3b6ec9604ba9e26 Mon Sep 17 00:00:00 2001 From: Izzy Miller Date: Thu, 29 Apr 2021 18:15:28 -0700 Subject: [PATCH] add update script --- update.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..767d63d --- /dev/null +++ b/update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +package_flag='' +version_flag='' +while getopts 'p:v:' flag; do +case "${flag}" in + p) package_flag="${OPTARG}" ;; + v) version_flag="${OPTARG}" ;; + esac +done +export PKG=$package_flag +export VERS=$version_flag +echo "Ok, going to update all extension-examples to ${PKG}@${VERS}... Cancel this command within 5 seconds if you don't want to do this!" +sleep 5 +echo "Updating!" +find . -type d -not -path '*/node_modules*' \ +-exec sh -c 'shopt -s failglob; ( : "$1"/*.lock ) 2>/dev/null && cd {} && yarn add "${PKG}@${VERS}"' - {} \; +