From ab4a28e27f41ef281fadfa9c72e9d29b50a6d3d6 Mon Sep 17 00:00:00 2001 From: typicode Date: Thu, 11 Oct 2018 10:45:14 +0900 Subject: [PATCH] Fix "[[: not found" --- src/installer/__tests__/__snapshots__/getScript.ts.snap | 8 ++++---- src/installer/getScript.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/installer/__tests__/__snapshots__/getScript.ts.snap b/src/installer/__tests__/__snapshots__/getScript.ts.snap index e8256e049..0cf70747a 100644 --- a/src/installer/__tests__/__snapshots__/getScript.ts.snap +++ b/src/installer/__tests__/__snapshots__/getScript.ts.snap @@ -9,8 +9,8 @@ scriptPath=\\"node_modules/husky/run.js\\" hookName=\`basename \\"$0\\"\` gitParams=\\"$*\\" -if [[ ! -z \\"\${HUSKY_DEBUG}\\" ]]; then - echo \\"\\\\nhusky:debug $hookName hook started...\\\\n\\" +if [ \\"\${HUSKY_DEBUG}\\" = \\"true\\" ]; then + echo \\"husky:debug $hookName hook started...\\" fi if ! command -v node >/dev/null 2>&1; then @@ -35,8 +35,8 @@ scriptPath=\\"node_modules/husky/run.js\\" hookName=\`basename \\"$0\\"\` gitParams=\\"$*\\" -if [[ ! -z \\"\${HUSKY_DEBUG}\\" ]]; then - echo \\"\\\\nhusky:debug $hookName hook started...\\\\n\\" +if [ \\"\${HUSKY_DEBUG}\\" = \\"true\\" ]; then + echo \\"husky:debug $hookName hook started...\\" fi if [ -f $scriptPath ]; then diff --git a/src/installer/getScript.ts b/src/installer/getScript.ts index 72ab13371..5fd93812f 100644 --- a/src/installer/getScript.ts +++ b/src/installer/getScript.ts @@ -22,8 +22,8 @@ scriptPath="${script}.js" hookName=\`basename "$0"\` gitParams="$*" -if [[ ! -z "$\{HUSKY_DEBUG\}" ]]; then - echo "\\nhusky:debug $hookName hook started...\\n" +if [ "$\{HUSKY_DEBUG\}" = "true" ]; then + echo "husky:debug $hookName hook started..." fi ${ platform !== 'win32'