33
44import * as childProcess from 'child_process' ;
55import * as path from 'path' ;
6- import * as fsx from 'fs-extra' ;
76
87import {
98 JsonFile ,
10- IPackageJson
9+ IPackageJson ,
10+ FileSystem
1111} from '@microsoft/node-core-library' ;
1212import { GulpTask } from '@microsoft/gulp-core-build' ;
1313
@@ -69,7 +69,7 @@ export abstract class BaseCmdTask<TTaskConfig extends IBaseCmdTaskConfig> extend
6969 public executeTask ( gulp : Object , completeCallback : ( error ?: string ) => void ) : Promise < void > | undefined {
7070 let binaryPackagePath : string = require . resolve ( this . _packageName ) ;
7171 let packageJsonPath : string ;
72- while ( ! fsx . existsSync ( packageJsonPath = path . join ( binaryPackagePath , 'package.json' ) ) ) {
72+ while ( ! FileSystem . exists ( packageJsonPath = path . join ( binaryPackagePath , 'package.json' ) ) ) {
7373 const tempBinaryPackagePath : string = path . dirname ( binaryPackagePath ) ;
7474 if ( binaryPackagePath === tempBinaryPackagePath ) {
7575 // We've hit the disk root
@@ -82,7 +82,7 @@ export abstract class BaseCmdTask<TTaskConfig extends IBaseCmdTaskConfig> extend
8282
8383 if ( this . taskConfig . overridePackagePath ) {
8484 // The package version is being overridden
85- if ( ! fsx . existsSync ( this . taskConfig . overridePackagePath ) ) {
85+ if ( ! FileSystem . exists ( this . taskConfig . overridePackagePath ) ) {
8686 completeCallback (
8787 `The specified ${ this . _packageName } path (${ this . taskConfig . overridePackagePath } ) does not ` +
8888 'exist'
@@ -98,7 +98,7 @@ export abstract class BaseCmdTask<TTaskConfig extends IBaseCmdTaskConfig> extend
9898 this . log ( `${ this . _packageName } version: ${ packageJson . version } ` ) ;
9999
100100 const binaryPath : string = path . resolve ( binaryPackagePath , this . _packageBinPath ) ;
101- if ( ! fsx . existsSync ( binaryPath ) ) {
101+ if ( ! FileSystem . exists ( binaryPath ) ) {
102102 completeCallback (
103103 `The binary is missing. This indicates that ${ this . _packageName } is not ` +
104104 'installed correctly.'
0 commit comments