From 299e40eb2996231be8b18138196a101164d144e7 Mon Sep 17 00:00:00 2001 From: typicode Date: Mon, 24 Jun 2019 14:43:47 +0200 Subject: [PATCH] change debug message --- src/runner/bin.ts | 4 ---- src/runner/index.ts | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runner/bin.ts b/src/runner/bin.ts index f9a8ece17..15492dbeb 100644 --- a/src/runner/bin.ts +++ b/src/runner/bin.ts @@ -1,8 +1,4 @@ import index from './' -import debug from '../debug' - -// Debug -debug(`CWD=${process.env.CWD}`) // Run hook index(process.argv) diff --git a/src/runner/index.ts b/src/runner/index.ts index 7e7bbbfa2..e03cbd705 100644 --- a/src/runner/index.ts +++ b/src/runner/index.ts @@ -2,6 +2,7 @@ import execa from 'execa' import getStdin from 'get-stdin' import path from 'path' import readPkg from 'read-pkg' +import debug from '../debug' import getConf from '../getConf' export interface Env extends NodeJS.ProcessEnv { @@ -18,6 +19,10 @@ export default async function run( getStdinFn: () => Promise = getStdin ): Promise { const cwd = path.resolve(scriptPath.split('node_modules')[0]) + + // Debug + debug(`CWD=${cwd}`) + // In some cases, package.json may not exist // For example, when switching to gh-page branch let pkg