switch-profile 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -251,7 +251,7 @@ The SSO login is missing or expired. Run `sp login` (or just switch to the profi
|
|
|
251
251
|
|
|
252
252
|
### SSO login hangs on a remote machine
|
|
253
253
|
|
|
254
|
-
The AWS CLI is waiting for a browser on the remote machine. Run `sp login --device`, or set **Settings > SSO login** to always use a device code.
|
|
254
|
+
The AWS CLI is waiting for a browser on the remote machine. Run `sp login --device`, or set **Settings > SSO login** to always use a device code. Since 2.3.1, `sp add` > A single SSO profile also uses a device code automatically over SSH; with an older version, press Ctrl+C and update (`sp` always runs the latest).
|
|
255
255
|
|
|
256
256
|
### The code is not in my clipboard over SSH
|
|
257
257
|
|
package/dist/cli.js
CHANGED
|
@@ -5419,7 +5419,7 @@ var require_package = __commonJS({
|
|
|
5419
5419
|
"package.json"(exports2, module2) {
|
|
5420
5420
|
module2.exports = {
|
|
5421
5421
|
name: "switch-profile",
|
|
5422
|
-
version: "2.3.
|
|
5422
|
+
version: "2.3.1",
|
|
5423
5423
|
main: "index.js",
|
|
5424
5424
|
bin: {
|
|
5425
5425
|
"switch-profile": "index.js"
|
|
@@ -6104,10 +6104,11 @@ var require_aws = __commonJS({
|
|
|
6104
6104
|
`${transforms.VERSION_KEY} = ${CLI_VERSION2}`
|
|
6105
6105
|
].join(NL) + NL, append = (str, section) => (str || "").trim() ? str.replace(/\s+$/, "") + NL + NL + section : section;
|
|
6106
6106
|
await writeAwsFile(AWS_CONFIG_FILE, append(configStr, newConfig)), await writeAwsFile(AWS_CREDS_FILE, append(credsStr, newCreds));
|
|
6107
|
-
})()), createSsoProfile = (name) => catchErrors((async () => {
|
|
6107
|
+
})()), createSsoProfile = (name, { loginMode } = {}) => catchErrors((async () => {
|
|
6108
6108
|
await awsCliV2Exists();
|
|
6109
|
+
let flags = loginFlags(loginMode || "auto", { env: process.env, platform: process.platform, cliVersion: await getAwsCliVersion() });
|
|
6109
6110
|
try {
|
|
6110
|
-
await run2("aws", ["configure", "sso", "--profile", name], { tee: !0 });
|
|
6111
|
+
await run2("aws", ["configure", "sso", "--profile", name, ...flags], { tee: !0 });
|
|
6111
6112
|
} catch (err) {
|
|
6112
6113
|
throw Object.assign(new Error(`'aws configure sso' failed: ${err.message}`, { cause: err }), { output: err.output || "" });
|
|
6113
6114
|
}
|
|
@@ -7919,7 +7920,7 @@ var require_commands = __commonJS({
|
|
|
7919
7920
|
...sessions.length ? [ui2.dim(`Portals already set up: ${sessions.map((x2) => `${x2.name} (${x2.sso_region || "?"})`).join(", ")}. Type one of these names to reuse it.`)] : []
|
|
7920
7921
|
].join(`
|
|
7921
7922
|
`));
|
|
7922
|
-
let [errors, upgraded] = await aws.createSsoProfile(name);
|
|
7923
|
+
let [errors, upgraded] = await aws.createSsoProfile(name, { loginMode: settings2.getLoginMode(state.settings) });
|
|
7923
7924
|
if (errors) {
|
|
7924
7925
|
let failed = errors.find((e) => e.output != null);
|
|
7925
7926
|
if (!failed)
|