From 8eb91b09377d800a2c30aa0796f48c80a044f726 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 29 Jun 2023 02:17:05 -0400 Subject: [PATCH] refactor: move prepare to a dedicated script --- package.json | 5 +++-- prepare.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 prepare.sh diff --git a/package.json b/package.json index b6153d9..180ceb3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "readme": "ERROR: No README data found!", "scripts": { - "prepare": "bash -c 'if command -v presetter &> /dev/null; then presetter bootstrap; fi'", + "prepare": "bash ./prepare.sh", "build": "run build", "semantic-release": "semantic-release" }, @@ -35,7 +35,8 @@ }, "files": [ "lib/**", - "templates/**" + "templates/**", + "prepare.sh" ], "publishConfig": { "access": "public" diff --git a/prepare.sh b/prepare.sh new file mode 100644 index 0000000..8e2391b --- /dev/null +++ b/prepare.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if command -v presetter &> /dev/null; then + # shellcheck disable=SC2154 + if [ -e "${npm_config_local_prefix}/node_modules/presetter-preset-strict" ]; then + presetter bootstrap + fi + +fi