Skip to content

Commit 082a8bb

Browse files
authored
Merge pull request #371 from salesforcecli/wr/updates
fix: overwrite file, don't create new one
2 parents 34db0a8 + 9f3b8ed commit 082a8bb

3 files changed

Lines changed: 1 addition & 15 deletions

File tree

messages/dev.convert.script.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ Replace flag "%s" with "%s":
5252

5353
Can't determine the appropriate replacement for %s.
5454

55-
# success
56-
57-
A converted file has been written to %s.
58-
5955
# errorComment
6056

6157
ERROR: Unable to convert this command; you must convert it manually.

src/commands/dev/convert/script.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,8 @@ export default class ConvertScript extends SfCommand<void> {
100100
data.push(line);
101101
}
102102
}
103-
// write the new script as a new file with a `-converted` suffix
104-
const output = `${flags.script.substring(0, flags.script.lastIndexOf('.'))}-converted${flags.script.substring(
105-
flags.script.lastIndexOf('.')
106-
)}`;
107103

108-
this.log(messages.getMessage('success', [output]));
109-
fs.writeFileSync(output, data.join(os.EOL));
104+
fs.writeFileSync(flags.script, data.join(os.EOL));
110105
}
111106

112107
private async replaceFlag(replacement: Snapshot, line: string, prompt: boolean): Promise<string> {

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,11 +1578,6 @@
15781578
"@types/yeoman-environment" "*"
15791579
"@types/yeoman-generator" "*"
15801580

1581-
"@types/yosay@^2.0.1":
1582-
version "2.0.1"
1583-
resolved "https://registry.yarnpkg.com/@types/yosay/-/yosay-2.0.1.tgz#320ff6ea4ba5d464a7c8ba1011d64fbf5562a1b0"
1584-
integrity sha512-MUFT7qfnt9f3yYAOLBupoChVUFmZkrLP6DlkruFJ560djzlgW5lX5JfqDwDfzuCzcyVdRQTNVr7dx/Up9PKTmw==
1585-
15861581
"@typescript-eslint/eslint-plugin@^5.62.0":
15871582
version "5.62.0"
15881583
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db"

0 commit comments

Comments
 (0)