Skip to content

Commit ad13206

Browse files
committed
remove debugging statement and fix spacing
1 parent dbbfc09 commit ad13206

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/core/src/awsService/ec2/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export class Ec2Connecter implements vscode.Disposable {
349349
*/
350350
export function getRemoveLinesCommand(pattern: string, hostOS: Ec2OS, filepath: string): string {
351351
// Linux allows not passing extension to -i, whereas macOS requires zero length extension.
352-
return `sed -i ${isLinux(hostOS) ? '' : "''"} /${pattern}/d ${filepath}`
352+
return `sed -i${isLinux(hostOS) ? '' : " ''"} /${pattern}/d ${filepath}`
353353
}
354354

355355
function isLinux(os: Ec2OS): boolean {

packages/core/src/test/awsService/ec2/model.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { fs } from '../../../shared'
1818
import path from 'path'
1919
import { ChildProcess } from '../../../shared/utilities/processUtils'
2020
import { isMac, isWin } from '../../../shared/vscode/env'
21+
import { inspect } from '../../../shared/utilities/collectionUtils'
2122

2223
describe('Ec2ConnectClient', function () {
2324
let client: Ec2Connecter
@@ -227,12 +228,14 @@ describe('getRemoveLinesCommand', async function () {
227228
const textFile = path.join(tempPath.uri.fsPath, 'test.txt')
228229
const originalContent = lineToStr(lines)
229230
await fs.writeFile(textFile, originalContent)
230-
console.log('running on os: %s', hostOS)
231231
const [command, ...args] = getRemoveLinesCommand('pattern', hostOS, textFile).split(' ')
232-
console.log('running command: %s with args %s', command, args.join(' '))
233232
const process = new ChildProcess(command, args, { collect: true })
234233
const result = await process.run()
235-
assert.strictEqual(result.exitCode, 0, `ChildProcess failed with error=${result.error}`)
234+
assert.strictEqual(
235+
result.exitCode,
236+
0,
237+
`Ran command '${command} ${args.join(' ')}' and failed with result ${inspect(result)}`
238+
)
236239

237240
const newContent = await fs.readFileText(textFile)
238241
assert.notStrictEqual(newContent, originalContent)

0 commit comments

Comments
 (0)