Skip to content

Commit

Permalink
Use different fs methods to support Node LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
wub committed Jul 18, 2017
1 parent a0cda35 commit 6f2c8d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const root = cwd.endsWith(suffix)
: cwd

// Install tsconfig
if (fs.access(path.join(root, 'tsconfig.json'), fs.constants.F_OK, () => {})) {
if (fs.existsSync(path.join(root, 'tsconfig.json'))) {
// TODO: If file exists, get existing config and merge correct values.
console.log(
'tsconfig detected - make sure you have the correct settings.'
'tsconfig detected - make sure you have the correct settings: https://github.com/wub/preact-cli-plugin-typescript#installation'
)
} else {
try {
Expand All @@ -34,10 +34,10 @@ if (fs.access(path.join(root, 'tsconfig.json'), fs.constants.F_OK, () => {})) {
}

// Install preact.config.js
if (fs.access(path.join(root, 'preact.config.js'), fs.constants.F_OK, () => {})) {
if (fs.existsSync(path.join(root, 'preact.config.js'))) {
// TODO: If file exists, get existing config and merge correct values.
console.log(
'preact.config.js detected - you can now import the plugin.'
'preact.config.js detected - you can now import the plugin: https://github.com/wub/preact-cli-plugin-typescript#existing-tsconfigjson'
)
} else {
try {
Expand Down

0 comments on commit 6f2c8d0

Please sign in to comment.