11'use strict' ;
2- import * as fs from 'fs' ;
3- import { cp } from 'fs/promises' ;
2+ import { readFile } from 'fs' ;
3+ import { copyFile } from 'fs/promises' ;
44import * as jsonc from 'jsonc-parser' ;
55import * as path from 'path' ;
66import * as vscode from 'vscode' ;
77import { ICommandAPI , ICommandCreator , IPreferencesAPI } from '../api' ;
88import { logger } from '../logger' ;
9- import { getClassName , getPackageName } from '../utilities' ;
109import * as fileUtils from '../shared/fileUtils' ;
10+ import { getClassName , getPackageName } from '../utilities' ;
1111
1212export interface IJavaJsonLayout {
1313 name : string ;
@@ -27,7 +27,7 @@ async function performCopy(
2727 try {
2828 // Copy files and track them
2929 const renamedCommand = path . join ( folder . fsPath , `${ replaceName } .java` ) ;
30- await cp (
30+ await copyFile (
3131 path . join ( commandRoot , command . foldername , `${ command . replacename } .java` ) ,
3232 renamedCommand
3333 ) ;
@@ -42,7 +42,7 @@ async function performCopy(
4242 replacements . set ( new RegExp ( command . replacename , 'g' ) , replaceName ) ;
4343
4444 // Process files with replacements
45- await fileUtils . processFile ( renamedCommand , folder . fsPath , replacements ) ;
45+ await fileUtils . processFile ( renamedCommand , replacements ) ;
4646
4747 const document = await vscode . workspace . openTextDocument ( vscode . Uri . file ( renamedCommand ) ) ;
4848 await vscode . window . showTextDocument ( document ) ;
@@ -59,7 +59,7 @@ export class Commands {
5959 constructor ( resourceRoot : string , core : ICommandAPI , preferences : IPreferencesAPI ) {
6060 const commandFolder = path . join ( resourceRoot , 'src' , 'commands' ) ;
6161 const resourceFile = path . join ( commandFolder , this . commandResourceName ) ;
62- fs . readFile ( resourceFile , 'utf8' , ( err , data ) => {
62+ readFile ( resourceFile , 'utf8' , ( err , data ) => {
6363 if ( err ) {
6464 logger . error ( 'Command file error: ' , err ) ;
6565 return ;
0 commit comments