Fix inconsistent quoting in the storybook script (https://github.com/woocommerce/woocommerce-admin/pull/6934)
This commit is contained in:
parent
eab3526211
commit
d98fe35faa
|
@ -6,21 +6,21 @@ TMP_DIR="$DIR/../storybook/wordpress/tmp";
|
|||
ARCHIVE_CSS_PATH="wordpress/wp-admin/css";
|
||||
ARCHIVE_IMG_PATH="wordpress/wp-admin/images";
|
||||
|
||||
mkdir -p $STORY_BOOK_CSS_PATH;
|
||||
mkdir -p $TMP_DIR;
|
||||
mkdir -p "$STORY_BOOK_CSS_PATH";
|
||||
mkdir -p "$TMP_DIR";
|
||||
|
||||
function download_and_extract_css {
|
||||
curl -o $1/wordpress-latest.zip https://wordpress.org/nightly-builds/wordpress-latest.zip;
|
||||
unzip -qq "$1/wordpress-latest.zip" "$ARCHIVE_CSS_PATH/*" "$ARCHIVE_IMG_PATH/*" -d $TMP_DIR;
|
||||
rsync -a "$TMP_DIR/$ARCHIVE_CSS_PATH" $STORYBOOK_WORDPRESS_DIR;
|
||||
rsync -a "$TMP_DIR/$ARCHIVE_IMG_PATH" $STORYBOOK_WORDPRESS_DIR;
|
||||
rm -fr $TMP_DIR;
|
||||
curl -o "$STORYBOOK_WORDPRESS_DIR/wordpress-latest.zip" https://wordpress.org/nightly-builds/wordpress-latest.zip;
|
||||
unzip -qq "$STORYBOOK_WORDPRESS_DIR/wordpress-latest.zip" "$ARCHIVE_CSS_PATH/*" "$ARCHIVE_IMG_PATH/*" -d "$TMP_DIR";
|
||||
rsync -a "$TMP_DIR/$ARCHIVE_CSS_PATH" "$STORYBOOK_WORDPRESS_DIR";
|
||||
rsync -a "$TMP_DIR/$ARCHIVE_IMG_PATH" "$STORYBOOK_WORDPRESS_DIR";
|
||||
rm -r "$TMP_DIR";
|
||||
}
|
||||
|
||||
if [ -z "$(find $STORY_BOOK_CSS_PATH -iname '*.css')" ] || [ "$1" == "-f" ]
|
||||
if [ -z "$(find "$STORY_BOOK_CSS_PATH" -iname '*.css')" ] || [ "$1" == "-f" ]
|
||||
then
|
||||
# The directory is not empty, import css
|
||||
download_and_extract_css $STORYBOOK_WORDPRESS_DIR;
|
||||
download_and_extract_css;
|
||||
else
|
||||
echo "Wordpress CSS already imported, pass -f to force an update";
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue