Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2.2 Fix: Using space inside parameter #16, use exec if command cont…
…ains "
- Loading branch information
Matthias Ludwig
committed
Apr 11, 2021
1 parent
97b37a6
commit dd3cc9e
Showing
7 changed files
with
165 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ build/Release | |
node_modules | ||
|
||
my_config.json | ||
|
||
my_config2.json | ||
|
||
.DS_Store | ||
npm-debug.log | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as util from 'util'; | ||
|
||
import { Aws, Options } from './index'; | ||
|
||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const config = require('../my_config.json'); | ||
|
||
//console.log('config', config); | ||
//https://github.com/Quobject/aws-cli-js/issues/16 | ||
|
||
|
||
describe('Using space inside parameter https://github.com/Quobject/aws-cli-js/issues/16', () => { | ||
const options = new Options( | ||
/* accessKey */ config.accessKeyId, | ||
/* secretKey */ config.secretAccessKey, | ||
/* sessionToken */ config.sessionToken, | ||
/* currentWorkingDirectory */ undefined, | ||
/* cliPath */ 'aws', | ||
); | ||
|
||
const aws = new Aws(options); | ||
|
||
it('with double quotes', () => { | ||
const command = 's3api put-object --bucket test.quobject.io --key pic.png --body ./testdata/smiley.png --content-type image/png --cache-control "public, max-age=31536000"'; | ||
return aws.command(command).then((data: any) => { | ||
console.log('data = ', util.inspect(data, { depth: 10 })); | ||
expect(data).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
it('without double quotes', () => { | ||
const command = 's3api put-object --bucket test.quobject.io --key pic.png --body ./testdata/smiley.png --content-type image/png --cache-control max-age=31536000'; | ||
return aws.command(command).then((data: any) => { | ||
console.log('data = ', util.inspect(data, { depth: 10 })); | ||
expect(data).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.