-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from nicodoggie/master
CVE-2020-28500: Updating lodash package, bump to 4.4.4
- Loading branch information
Showing
6 changed files
with
7,401 additions
and
4,367 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarnPath: .yarn/releases/yarn-4.0.0-rc.43.cjs |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
{ | ||
"name": "@splitmedialabs/devctl", | ||
"version": "4.4.2", | ||
"version": "4.4.4", | ||
"author": "Makara Sok", | ||
"description": "Easily start developing in monorepos with docker-compose", | ||
"main": "dist/cli.js", | ||
"bin": { | ||
"devctl": "./bin/devctl.js" | ||
}, | ||
"bin": "./bin/devctl.js", | ||
"scripts": { | ||
"build": "tsc -b", | ||
"clean": "rimraf dist/", | ||
|
@@ -59,8 +57,8 @@ | |
"rimraf": "^4.1.2", | ||
"typescript": "^4.6.3" | ||
}, | ||
|
||
"volta": { | ||
"node": "16.18.1" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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 |
---|---|---|
@@ -1,12 +1,91 @@ | ||
const YAML = require('js-yaml'); | ||
const { filesystem, prompt } = require('@cipherstash/gluegun'); | ||
const get = require('lodash/get'); | ||
const getDockerHost = require('../utils/getDockerHost'); | ||
|
||
async function askEnvironment(project) { | ||
if (Object.values(project.environment).length === 1) { | ||
return { | ||
environment: Object.values(project.environment)[0].name, | ||
}; | ||
} | ||
|
||
return await prompt.ask({ | ||
type: 'select', | ||
name: 'environment', | ||
message: 'Which environment do you want to use?', | ||
choices: Object.values(project.environment).map((env) => ({ | ||
name: env.name, | ||
message: env.name, | ||
hint: env.description, | ||
value: env.name, | ||
})), | ||
initial: get(project, 'current.environment', null), | ||
}); | ||
} | ||
|
||
async function askServices(project) { | ||
const allChoices = Object.values(project.services) | ||
.map((service) => ({ | ||
name: service.name, | ||
message: service.name, | ||
hint: service.description, | ||
value: service.name, | ||
category: service.category, | ||
})) | ||
.sort(function (a, b) { | ||
const keyA = a.name.toLowerCase(); | ||
const keyB = b.name.toLowerCase(); | ||
if (keyA < keyB) return -1; | ||
if (keyA > keyB) return 1; | ||
return 0; | ||
}); | ||
|
||
const choices = allChoices.filter((c) => c.category !== 'always'); | ||
const choicesArray = choices.map((c) => c.value); | ||
const always = allChoices | ||
.filter((c) => c.category === 'always') | ||
.map((c) => c.value); | ||
|
||
const initial = get(project, 'current.services', []).filter((c) => | ||
choicesArray.includes(c) | ||
); | ||
|
||
const { services } = await prompt.ask({ | ||
type: 'multiselect', | ||
name: 'services', | ||
message: 'Which services do you want to work on?', | ||
choices, | ||
initial, | ||
}); | ||
|
||
return { services: [...services, ...always] }; | ||
} | ||
|
||
async function saveCurrentConfig(path, config) { | ||
return filesystem.write(path, YAML.dump(config)); | ||
} | ||
|
||
module.exports = { | ||
name: 'switch-env', | ||
description: `Switch environments without running`, | ||
hidden: true, | ||
description: `Switch services and/or environment`, | ||
run: async (toolbox) => { | ||
await require('../cli.js').run('switch-current'); | ||
const project = toolbox.config; | ||
|
||
const { services } = await askServices(project); | ||
|
||
const { environment } = await askEnvironment(project); | ||
|
||
const currentConfig = { | ||
services, | ||
environment, | ||
dockerhost: '', | ||
}; | ||
|
||
await saveCurrentConfig(project.paths.current, currentConfig); | ||
await require('../cli.js').run('pull-secrets'); | ||
await require('../cli.js').run('compile'); | ||
|
||
process.exit(0); | ||
return; | ||
}, | ||
}; |
Oops, something went wrong.