Skip to content

Commit d30a067

Browse files
committed
fix(files): touch command to creation a new file
1 parent 94210ed commit d30a067

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/commands/files.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ export async function createFile(args = []) {
626626
})
627627
});
628628

629-
if (statResponse.ok) {
629+
if (!statResponse.ok) {
630+
console.log(chalk.cyan('File does not exists. Il will be created.'));
631+
} else {
630632
const statData = await statResponse.json();
631633
if (statData && statData.id) {
632634
if (!overwrite) {
@@ -635,9 +637,6 @@ export async function createFile(args = []) {
635637
}
636638
console.log(chalk.yellow(`File "${filePath}" already exists. It will be overwritten.`));
637639
}
638-
} else if (statResponse.status !== 404) {
639-
console.error(chalk.red('Failed to check if file exists.'));
640-
return false;
641640
}
642641

643642
// Step 2: Check disk space

src/modules/ProfileModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ProfileModule {
116116
return this.addProfileWizard();
117117
}
118118

119-
console.log('doing this branch');
119+
// console.log('doing this branch');
120120
const answer = await inquirer.prompt([
121121
{
122122
name: 'profile',

0 commit comments

Comments
 (0)