Skip to content

Commit

Permalink
Fix cache folder location
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Oct 15, 2019
1 parent a8640ca commit cffc994
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const paths = {
appPackageJson: resolveApp('package.json'),
testsSetup: resolveApp('test/setupTests.ts'),
appRoot: resolveApp('.'),
cache: resolveApp('node_modules/.cache'),
appSrc: resolveApp('src'),
appErrorsJson: resolveApp('errors/codes.json'),
appErrors: resolveApp('errors'),
Expand Down
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const createLogger = require('progress-estimator');
// All configuration keys are optional, but it's recommended to specify a storage location.
// Learn more about configuration options below.
const logger = createLogger({
storagePath: path.join(__dirname, '.progress-estimator'),
storagePath: path.join(paths.cache, '.progress-estimator'),
});

const prog = sade('tsdx');
Expand All @@ -52,7 +52,7 @@ let appPackageJson: {

try {
appPackageJson = fs.readJSONSync(resolveApp('package.json'));
} catch (e) {}
} catch (e) { }

// check for custom tsdx.config.js
let tsdxConfig = {
Expand Down Expand Up @@ -81,8 +81,8 @@ async function jsOrTs(filename: string) {
const extension = (await isFile(resolveApp(filename + '.ts')))
? '.ts'
: (await isFile(resolveApp(filename + '.tsx')))
? '.tsx'
: '.js';
? '.tsx'
: '.js';

return resolveApp(`${filename}${extension}`);
}
Expand All @@ -95,7 +95,7 @@ async function getInputs(entries: string[], source?: string) {
entries && entries.length
? entries
: (source && resolveApp(source)) ||
((await isDir(resolveApp('src'))) && (await jsOrTs('src/index')))
((await isDir(resolveApp('src'))) && (await jsOrTs('src/index')))
)
.map(file => glob(file))
.forEach(input => inputs.push(input));
Expand Down Expand Up @@ -168,7 +168,7 @@ async function moveTypes() {
overwrite: true,
});
await fs.remove(paths.appDist + '/src');
} catch (e) {}
} catch (e) { }
}

prog
Expand Down Expand Up @@ -371,7 +371,7 @@ prog
`);
try {
await moveTypes();
} catch (_error) {}
} catch (_error) { }
}
});
});
Expand Down Expand Up @@ -492,7 +492,7 @@ prog
// Allow overriding with jest.config
const jestConfigContents = require(paths.jestConfig);
jestConfig = { ...jestConfig, ...jestConfigContents };
} catch {}
} catch { }

argv.push(
'--config',
Expand Down

0 comments on commit cffc994

Please sign in to comment.