Socket
Socket
Sign inDemoInstall

@swsdk/plugin-config

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swsdk/plugin-config - npm Package Compare versions

Comparing version 3.0.0 to 3.2.0

19

lib/commands/config/set.js

@@ -5,6 +5,6 @@ "use strict";

const command_1 = require("@oclif/command");
const fs_extra_1 = require("fs-extra");
const core_1 = require("@swsdk/core");
const node_path_1 = require("node:path");
const show_1 = require("./show");
const node_fs_1 = require("node:fs");
const src_1 = require("@swsdk/core/src");
// noinspection JSUnusedGlobalSymbols

@@ -16,15 +16,12 @@ class Set extends core_1.Base {

const configDir = this.config.configDir;
const configPath = (0, node_path_1.join)(configDir, '.swsdkrc.json');
let configValues = {
owner: 'swimlane',
gitProtocol: 'https',
};
if (await (0, core_1.fileExists)(configPath)) {
configValues = Object.assign(configValues, (await (0, fs_extra_1.readJson)(configPath)));
if (!await (0, core_1.directoryExists)(configDir)) {
await node_fs_1.promises.mkdir(configDir, { recursive: true });
}
Object.assign(configValues, {
const configService = new src_1.ConfigService(configDir);
const loaded = await configService.loadConfig();
const updated = Object.assign(loaded || core_1.ConfigTypeDefault, {
owner,
gitProtocol,
});
await (0, fs_extra_1.writeJson)(configPath, configValues, { spaces: 2, EOL: '\n' });
await configService.saveConfig(updated);
await show_1.Show.run([]);

@@ -31,0 +28,0 @@ }

@@ -1,1 +0,1 @@

{"version":"3.0.0","commands":{"config:set":{"id":"config:set","description":"Used to set config options","pluginName":"@swsdk/plugin-config","pluginType":"core","aliases":[],"flags":{"git-protocol":{"name":"git-protocol","type":"option","description":"the protocol to use for git clone and push operations","options":["https","ssh"]},"owner":{"name":"owner","type":"option","description":"The default GitHub Owner"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:show":{"id":"config:show","description":"Used display current config settings","pluginName":"@swsdk/plugin-config","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]}}}
{"version":"3.2.0","commands":{"config:set":{"id":"config:set","description":"Used to set config options","pluginName":"@swsdk/plugin-config","pluginType":"core","aliases":[],"flags":{"git-protocol":{"name":"git-protocol","type":"option","description":"the protocol to use for git clone and push operations","options":["https","ssh"]},"owner":{"name":"owner","type":"option","description":"The default GitHub Owner"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:show":{"id":"config:show","description":"Used display current config settings","pluginName":"@swsdk/plugin-config","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]}}}
{
"name": "@swsdk/plugin-config",
"description": "Plugin for managing configuration.",
"version": "3.0.0",
"version": "3.2.0",
"author": "Swimlane",

@@ -57,3 +57,3 @@ "bugs": {

"@oclif/parser": "^3.8.5",
"@swsdk/core": "^3.0.0",
"@swsdk/core": "^3.2.0",
"cli-ux": "^5.6.3",

@@ -65,3 +65,3 @@ "fs-extra": "^10.0.0",

},
"gitHead": "3caaf9ad81b51f2ca1006618cc6be5f76fcad164"
"gitHead": "18fdabaf35275d85a755e995bc81348bdf33887b"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc