Skip to content

Commit

Permalink
Remove dedent
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Jul 22, 2020
1 parent 7d22292 commit e7d9aca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`cherrypickAndCreateTargetPullRequest when cherry-picking fails should start conflict resolution mode 5`] = `
exports[`cherrypickAndCreateTargetPullRequest when cherry-picking fails should start conflict resolution mode 4`] = `
Array [
Array [
"git reset --hard && git clean -d --force && git fetch elastic 6.x && git checkout -B backport/6.x/commit-mySha elastic/6.x --no-track",
Expand Down
33 changes: 24 additions & 9 deletions src/ui/cherrypickAndCreatePullRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,26 +233,41 @@ describe('cherrypickAndCreateTargetPullRequest', () => {
number: 1337,
});

expect(promptSpy.mock.calls[0]).toMatchInlineSnapshot(`
expect(promptSpy.mock.calls).toMatchInlineSnapshot(`
Array [
"The following files have conflicts:
Array [
"
The following files have conflicts:
- /myHomeDir/.backport/repositories/elastic/kibana/conflicting-file.txt
Repository: /myHomeDir/.backport/repositories/elastic/kibana
Press ENTER when the conflicts are resolved and files are staged",
]
`);
Press ENTER when the conflicts are resolved and files are staged
",
],
Array [
"
The following files have conflicts:
- /myHomeDir/.backport/repositories/elastic/kibana/conflicting-file.txt
expect(promptSpy.mock.calls[2]).toMatchInlineSnapshot(`
Array [
"The following files are unstaged:
Repository: /myHomeDir/.backport/repositories/elastic/kibana
Press ENTER when the conflicts are resolved and files are staged
",
],
Array [
"
The following files are unstaged:
- /myHomeDir/.backport/repositories/elastic/kibana/conflicting-file.txt
Repository: /myHomeDir/.backport/repositories/elastic/kibana
Press ENTER when the conflicts are resolved and files are staged",
Press ENTER when the conflicts are resolved and files are staged
",
],
]
`);

Expand Down
15 changes: 6 additions & 9 deletions src/ui/cherrypickAndCreateTargetPullRequest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import chalk from 'chalk';
import dedent from 'dedent';
import difference from 'lodash.difference';
import isEmpty from 'lodash.isempty';
import ora = require('ora');
Expand Down Expand Up @@ -233,16 +232,14 @@ async function listConflictingAndUnstagedFiles(options: BackportOptions) {
: '';

consoleLog(''); // linebreak
const res = await confirmPrompt(
dedent(`
${conflictSection}
${unstagedSection}
const res = await confirmPrompt(`
${conflictSection}
${unstagedSection}
${chalk.reset(`Repository: ${getRepoPath(options)}`)}
${chalk.reset(`Repository: ${getRepoPath(options)}`)}
Press ENTER when the conflicts are resolved and files are staged
`)
);
Press ENTER when the conflicts are resolved and files are staged
`);
if (!res) {
throw new HandledError('Aborted');
}
Expand Down

0 comments on commit e7d9aca

Please sign in to comment.