@automattic/vip 4.1.6 → 4.1.8
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/assets/dev-env.lando.template.yml.ejs +1 -1
- package/dist/bin/vip-app-deploy-token-generate.js +110 -78
- package/dist/bin/vip-app-deploy-token.js +24 -16
- package/dist/bin/vip-app-deploy-validate.js +45 -41
- package/dist/bin/vip-app-deploy.js +222 -215
- package/dist/bin/vip-app-list.js +59 -43
- package/dist/bin/vip-app.js +97 -66
- package/dist/bin/vip-backup-db.js +36 -29
- package/dist/bin/vip-backup.js +16 -9
- package/dist/bin/vip-cache-purge-url.js +93 -55
- package/dist/bin/vip-cache.js +23 -14
- package/dist/bin/vip-config-envvar-delete.js +74 -73
- package/dist/bin/vip-config-envvar-get-all.js +68 -68
- package/dist/bin/vip-config-envvar-get.js +46 -46
- package/dist/bin/vip-config-envvar-list.js +54 -57
- package/dist/bin/vip-config-envvar-set.js +102 -96
- package/dist/bin/vip-config-envvar.js +38 -24
- package/dist/bin/vip-config-software-get.js +88 -75
- package/dist/bin/vip-config-software-update.js +116 -120
- package/dist/bin/vip-config-software.js +31 -21
- package/dist/bin/vip-config.js +25 -17
- package/dist/bin/vip-db-phpmyadmin.js +40 -39
- package/dist/bin/vip-db.js +13 -12
- package/dist/bin/vip-defensive-mode-configure.js +197 -197
- package/dist/bin/vip-defensive-mode-disable.js +43 -35
- package/dist/bin/vip-defensive-mode-enable.js +47 -38
- package/dist/bin/vip-defensive-mode.js +28 -17
- package/dist/bin/vip-dev-env-create.js +147 -104
- package/dist/bin/vip-dev-env-destroy.js +48 -39
- package/dist/bin/vip-dev-env-envvar-delete.js +60 -49
- package/dist/bin/vip-dev-env-envvar-get-all.js +52 -45
- package/dist/bin/vip-dev-env-envvar-get.js +48 -37
- package/dist/bin/vip-dev-env-envvar-list.js +48 -41
- package/dist/bin/vip-dev-env-envvar-set.js +83 -70
- package/dist/bin/vip-dev-env-envvar.js +38 -23
- package/dist/bin/vip-dev-env-exec.js +81 -74
- package/dist/bin/vip-dev-env-import-media.js +34 -26
- package/dist/bin/vip-dev-env-import-sql.js +65 -51
- package/dist/bin/vip-dev-env-import.js +23 -14
- package/dist/bin/vip-dev-env-info.js +59 -50
- package/dist/bin/vip-dev-env-list.js +34 -31
- package/dist/bin/vip-dev-env-logs.js +59 -49
- package/dist/bin/vip-dev-env-purge.js +71 -63
- package/dist/bin/vip-dev-env-shell.js +82 -71
- package/dist/bin/vip-dev-env-start.js +77 -65
- package/dist/bin/vip-dev-env-stop.js +80 -74
- package/dist/bin/vip-dev-env-sync-sql.js +80 -72
- package/dist/bin/vip-dev-env-sync.js +18 -11
- package/dist/bin/vip-dev-env-update.js +93 -84
- package/dist/bin/vip-dev-env.js +25 -8
- package/dist/bin/vip-edge-workers-build.js +82 -54
- package/dist/bin/vip-edge-workers-delete.js +84 -52
- package/dist/bin/vip-edge-workers-deploy.js +186 -126
- package/dist/bin/vip-edge-workers-disable.js +75 -44
- package/dist/bin/vip-edge-workers-enable.js +86 -54
- package/dist/bin/vip-edge-workers-get.js +108 -88
- package/dist/bin/vip-edge-workers-init.js +83 -53
- package/dist/bin/vip-edge-workers-list.js +89 -54
- package/dist/bin/vip-edge-workers-new.js +98 -69
- package/dist/bin/vip-edge-workers-validate.js +123 -82
- package/dist/bin/vip-edge-workers.js +19 -6
- package/dist/bin/vip-export-sql.js +75 -69
- package/dist/bin/vip-export.js +12 -7
- package/dist/bin/vip-import-media-abort.js +99 -73
- package/dist/bin/vip-import-media-status.js +83 -51
- package/dist/bin/vip-import-media.js +165 -166
- package/dist/bin/vip-import-sql-status.js +75 -45
- package/dist/bin/vip-import-sql.js +536 -596
- package/dist/bin/vip-import-validate-files.js +122 -141
- package/dist/bin/vip-import-validate-sql.js +52 -16
- package/dist/bin/vip-import.js +16 -7
- package/dist/bin/vip-logout.js +17 -13
- package/dist/bin/vip-logs.js +209 -183
- package/dist/bin/vip-search-replace.js +85 -53
- package/dist/bin/vip-slowlogs.js +168 -147
- package/dist/bin/vip-sync.js +163 -133
- package/dist/bin/vip-whoami.js +71 -35
- package/dist/bin/vip-wp.js +506 -549
- package/dist/bin/vip.js +161 -116
- package/dist/commands/backup-db.js +183 -149
- package/dist/commands/dev-env-import-sql.js +162 -117
- package/dist/commands/dev-env-sync-sql.js +372 -330
- package/dist/commands/export-sql.js +441 -425
- package/dist/commands/phpmyadmin.js +232 -212
- package/dist/commands/wp-ssh.js +218 -187
- package/dist/lib/analytics/clients/tracks.js +84 -91
- package/dist/lib/analytics/index.js +27 -27
- package/dist/lib/api/app.js +37 -36
- package/dist/lib/api/cache-purge.js +17 -20
- package/dist/lib/api/constants.js +5 -6
- package/dist/lib/api/edge-workers.js +84 -135
- package/dist/lib/api/error-debug.js +10 -13
- package/dist/lib/api/feature-flags.js +16 -17
- package/dist/lib/api/http.js +47 -48
- package/dist/lib/api/user.js +17 -18
- package/dist/lib/api.js +107 -116
- package/dist/lib/app-logs/app-logs.js +24 -25
- package/dist/lib/app-slowlogs/app-slowlogs.js +23 -24
- package/dist/lib/app-slowlogs/types.js +2 -1
- package/dist/lib/app.js +6 -8
- package/dist/lib/backup-storage-availability/backup-storage-availability.js +119 -119
- package/dist/lib/backup-storage-availability/docker-machine-not-found-error.js +5 -6
- package/dist/lib/cli/apiConfig.js +71 -41
- package/dist/lib/cli/command.js +1120 -873
- package/dist/lib/cli/config.js +29 -29
- package/dist/lib/cli/envAlias.js +35 -50
- package/dist/lib/cli/exit.js +19 -19
- package/dist/lib/cli/format.js +172 -172
- package/dist/lib/cli/progress.js +193 -236
- package/dist/lib/cli/prompt.js +14 -15
- package/dist/lib/cli/runtime-mode.js +5 -6
- package/dist/lib/client-file-uploader.js +489 -641
- package/dist/lib/config/software.js +206 -212
- package/dist/lib/constants/dev-environment.js +40 -37
- package/dist/lib/constants/file-size.js +6 -7
- package/dist/lib/constants/vipgo.js +24 -12
- package/dist/lib/custom-deploy/custom-deploy.js +138 -120
- package/dist/lib/database.js +88 -85
- package/dist/lib/defensive-mode/api.js +41 -46
- package/dist/lib/defensive-mode/cli-helpers.js +40 -40
- package/dist/lib/dev-environment/dev-environment-cli.js +776 -735
- package/dist/lib/dev-environment/dev-environment-configuration-file.js +224 -191
- package/dist/lib/dev-environment/dev-environment-core.js +697 -732
- package/dist/lib/dev-environment/dev-environment-database.js +57 -41
- package/dist/lib/dev-environment/dev-environment-lando.js +734 -666
- package/dist/lib/dev-environment/docker-utils.js +96 -90
- package/dist/lib/dev-environment/env-vars.js +61 -59
- package/dist/lib/dev-environment/lando-loader.js +6 -7
- package/dist/lib/dev-environment/types.js +2 -1
- package/dist/lib/edge-workers/confirmation.js +42 -36
- package/dist/lib/edge-workers/deployment.js +150 -159
- package/dist/lib/edge-workers/index.js +68 -85
- package/dist/lib/edge-workers/location.js +26 -26
- package/dist/lib/edge-workers/output.js +14 -15
- package/dist/lib/edge-workers/project.js +123 -132
- package/dist/lib/edge-workers/toolchains/assemblyscript/constants.js +6 -8
- package/dist/lib/edge-workers/toolchains/assemblyscript/index.js +100 -101
- package/dist/lib/edge-workers/toolchains/assemblyscript/templates.js +31 -33
- package/dist/lib/edge-workers/toolchains/index.js +15 -15
- package/dist/lib/edge-workers/types.js +10 -38
- package/dist/lib/edge-workers/validation.js +161 -150
- package/dist/lib/env.js +16 -17
- package/dist/lib/envvar/api-delete.js +16 -18
- package/dist/lib/envvar/api-get-all.js +15 -19
- package/dist/lib/envvar/api-get.js +8 -9
- package/dist/lib/envvar/api-list.js +16 -21
- package/dist/lib/envvar/api-set.js +20 -19
- package/dist/lib/envvar/api.js +34 -29
- package/dist/lib/envvar/input.js +29 -34
- package/dist/lib/envvar/logging.js +9 -11
- package/dist/lib/envvar/read-file.js +6 -7
- package/dist/lib/http/download-file.js +76 -44
- package/dist/lib/http/proxy-agent.js +37 -40
- package/dist/lib/http/proxy-dispatcher.js +69 -71
- package/dist/lib/keychain/insecure.js +40 -36
- package/dist/lib/keychain/keychain.js +2 -1
- package/dist/lib/keychain/secure.js +16 -15
- package/dist/lib/keychain.js +22 -22
- package/dist/lib/live-backup-copy.js +117 -115
- package/dist/lib/logout.js +17 -19
- package/dist/lib/media-import/config.js +15 -14
- package/dist/lib/media-import/media-file-import.js +9 -13
- package/dist/lib/media-import/progress.js +53 -65
- package/dist/lib/media-import/status.js +241 -256
- package/dist/lib/media-import/utils.js +15 -15
- package/dist/lib/node-version-check.js +16 -16
- package/dist/lib/promise.js +16 -17
- package/dist/lib/read-file.js +48 -16
- package/dist/lib/rechallenge/client.js +37 -43
- package/dist/lib/rechallenge/errors.js +38 -37
- package/dist/lib/rechallenge/flow.js +148 -123
- package/dist/lib/rechallenge/index.js +23 -24
- package/dist/lib/rechallenge/link.js +153 -151
- package/dist/lib/rechallenge/open-browser.js +14 -17
- package/dist/lib/rechallenge/token-cache.js +83 -86
- package/dist/lib/rechallenge/types.js +5 -14
- package/dist/lib/retry.js +93 -129
- package/dist/lib/search-and-replace.js +164 -148
- package/dist/lib/site-import/db-file-import.js +12 -16
- package/dist/lib/site-import/status.js +291 -291
- package/dist/lib/token.js +86 -87
- package/dist/lib/tracker.js +51 -62
- package/dist/lib/types/graphql/rate-limit-exceeded-error.js +2 -1
- package/dist/lib/types.js +2 -1
- package/dist/lib/user-error.js +6 -8
- package/dist/lib/utils.js +81 -87
- package/dist/lib/validations/custom-deploy.js +218 -186
- package/dist/lib/validations/is-multi-site-sql-dump.js +6 -6
- package/dist/lib/validations/is-multi-site.js +83 -50
- package/dist/lib/validations/is-multisite-domain-mapped.js +92 -62
- package/dist/lib/validations/line-by-line.js +78 -46
- package/dist/lib/validations/site-type.js +59 -63
- package/dist/lib/validations/sql-insert-parser.js +415 -0
- package/dist/lib/validations/sql.js +551 -431
- package/dist/lib/validations/utils.js +27 -29
- package/dist/lib/vip-import-validate-files.js +481 -490
- package/dist/lib/wp/helpers.js +41 -45
- package/dist/lib/wp/readline.js +21 -57
- package/dist/lib/xdg-data.js +11 -12
- package/helpers/mark-cli-executable.js +9 -0
- package/node_modules/@apollo/client/CHANGELOG.md +10 -0
- package/node_modules/@apollo/client/__cjs/cache/inmemory/helpers.cjs +5 -0
- package/node_modules/@apollo/client/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/inMemoryCache.cjs +2 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/key-extractor.cjs +14 -2
- package/node_modules/@apollo/client/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/policies.cjs +16 -0
- package/node_modules/@apollo/client/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/cache/inmemory/policies.d.cts +2 -0
- package/node_modules/@apollo/client/__cjs/cache/inmemory/writeToStore.cjs +3 -2
- package/node_modules/@apollo/client/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/core/QueryInfo.cjs +9 -1
- package/node_modules/@apollo/client/__cjs/core/QueryInfo.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/core/QueryInfo.d.cts +1 -1
- package/node_modules/@apollo/client/__cjs/core/QueryManager.cjs +10 -3
- package/node_modules/@apollo/client/__cjs/core/QueryManager.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/node_modules/@apollo/client/__cjs/react/hooks/useFragment.d.cts +42 -43
- package/node_modules/@apollo/client/__cjs/version.cjs +1 -1
- package/node_modules/@apollo/client/cache/inmemory/helpers.js +5 -0
- package/node_modules/@apollo/client/cache/inmemory/helpers.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js +2 -1
- package/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/key-extractor.js +14 -2
- package/node_modules/@apollo/client/cache/inmemory/key-extractor.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/policies.d.ts +2 -0
- package/node_modules/@apollo/client/cache/inmemory/policies.js +17 -1
- package/node_modules/@apollo/client/cache/inmemory/policies.js.map +1 -1
- package/node_modules/@apollo/client/cache/inmemory/writeToStore.js +3 -2
- package/node_modules/@apollo/client/cache/inmemory/writeToStore.js.map +1 -1
- package/node_modules/@apollo/client/core/QueryInfo.d.ts +1 -1
- package/node_modules/@apollo/client/core/QueryInfo.js +10 -2
- package/node_modules/@apollo/client/core/QueryInfo.js.map +1 -1
- package/node_modules/@apollo/client/core/QueryManager.js +10 -3
- package/node_modules/@apollo/client/core/QueryManager.js.map +1 -1
- package/node_modules/@apollo/client/package.json +1 -1
- package/node_modules/@apollo/client/react/hooks/useFragment.d.ts +42 -43
- package/node_modules/@apollo/client/react/hooks/useFragment.js.map +1 -1
- package/node_modules/@apollo/client/react/hooks-compiled/useFragment.d.ts +42 -43
- package/node_modules/@apollo/client/react/hooks-compiled/useFragment.js.map +1 -1
- package/node_modules/@apollo/client/version.js +1 -1
- package/node_modules/@automattic/vip-search-replace/README.md +6 -1
- package/node_modules/@automattic/vip-search-replace/lib/index.js +46 -14
- package/node_modules/@automattic/vip-search-replace/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/check-disk-space/README.md +92 -32
- package/node_modules/check-disk-space/dist/check-disk-space.d.mts +58 -0
- package/node_modules/check-disk-space/dist/check-disk-space.mjs +170 -190
- package/node_modules/check-disk-space/package.json +43 -71
- package/node_modules/cpu-features/build/Makefile +2 -2
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_windows.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o.d +1 -1
- package/node_modules/cpu-features/build/Release/.deps/Release/obj.target/cpufeatures/src/binding.o.d +157 -145
- package/node_modules/cpu-features/build/Release/cpufeatures.node +0 -0
- package/node_modules/cpu-features/build/Release/obj.target/cpufeatures/src/binding.o +0 -0
- package/node_modules/cpu-features/build/Release/obj.target/cpufeatures.node +0 -0
- package/node_modules/cpu-features/build/config.gypi +100 -31
- package/node_modules/cpu-features/build/cpufeatures.target.mk +14 -14
- package/node_modules/cpu-features/build/deps/cpu_features/cpu_features.target.mk +14 -14
- package/node_modules/ssh2/lib/protocol/crypto/build/Makefile +2 -2
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/.deps/Release/obj.target/sshcrypto/src/binding.o.d.raw +136 -0
- package/node_modules/ssh2/lib/protocol/crypto/build/sshcrypto.target.mk +14 -14
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/package.json +44 -13
- package/dist/lib/analytics/clients/client.js +0 -1
- package/dist/lib/analytics/clients/pendo.js +0 -78
- package/helpers/check-version.js +0 -16
- package/node_modules/check-disk-space/dist/check-disk-space.cjs +0 -210
- package/node_modules/check-disk-space/dist/check-disk-space.d.ts +0 -53
- package/node_modules/fetch-retry/.eslintignore +0 -1
- package/node_modules/fetch-retry/.eslintrc.yml +0 -20
- package/node_modules/fetch-retry/.github/workflows/node.js.yml +0 -32
- package/node_modules/fetch-retry/.husky/pre-commit +0 -6
- package/node_modules/fetch-retry/.nycrc.json +0 -24
- package/node_modules/fetch-retry/.travis.yml +0 -3
- package/node_modules/fetch-retry/LICENSE +0 -21
- package/node_modules/fetch-retry/README.md +0 -128
- package/node_modules/fetch-retry/dist/fetch-retry.umd.js +0 -151
- package/node_modules/fetch-retry/index.d.ts +0 -29
- package/node_modules/fetch-retry/index.js +0 -143
- package/node_modules/fetch-retry/package.json +0 -41
- package/node_modules/fetch-retry/rollup.config.js +0 -12
- package/node_modules/fetch-retry/test/.eslintrc.yml +0 -7
- package/node_modules/fetch-retry/test/integration/index.js +0 -212
- package/node_modules/fetch-retry/test/integration/mock-api/index.js +0 -42
- package/node_modules/fetch-retry/test/unit/index.js +0 -1169
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/.deps/Release/obj.target/sshcrypto/src/binding.o.d +0 -265
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/.deps/Release/obj.target/sshcrypto.node.d +0 -1
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/.deps/Release/sshcrypto.node.d +0 -1
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/obj.target/sshcrypto/src/binding.o +0 -0
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/obj.target/sshcrypto.node +0 -0
- package/node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node +0 -0
|
@@ -1,88 +1,95 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
8
|
+
const dev_environment_cli_1 = require("../lib/dev-environment/dev-environment-cli");
|
|
9
|
+
const dev_environment_core_1 = require("../lib/dev-environment/dev-environment-core");
|
|
10
|
+
const dev_environment_lando_1 = require("../lib/dev-environment/dev-environment-lando");
|
|
11
|
+
const tracker_1 = require("../lib/tracker");
|
|
12
|
+
const user_error_1 = __importDefault(require("../lib/user-error"));
|
|
11
13
|
const exampleUsage = 'vip dev-env exec';
|
|
12
14
|
const usage = 'vip dev-env exec';
|
|
13
15
|
const ENV_UP_CHECK_ATTEMPTS = 5;
|
|
14
16
|
const ENV_UP_CHECK_DELAY_MS = 1500;
|
|
15
17
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
16
18
|
async function waitForEnvironmentReadiness(lando, slug) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const instancePath = (0, dev_environment_core_1.getEnvironmentPath)(slug);
|
|
20
|
+
return pollEnvironmentReadiness(lando, instancePath, 1);
|
|
19
21
|
}
|
|
20
22
|
async function pollEnvironmentReadiness(lando, instancePath, attempt) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
if (attempt >= ENV_UP_CHECK_ATTEMPTS) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
await sleep(ENV_UP_CHECK_DELAY_MS);
|
|
28
|
-
return pollEnvironmentReadiness(lando, instancePath, attempt + 1);
|
|
29
|
-
}
|
|
30
|
-
const examples = [{
|
|
31
|
-
usage: `${exampleUsage} --slug=example-site -- wp post list`,
|
|
32
|
-
description: 'Run a WP-CLI command against a local environment named "example-site".\n' + ' * A double dash ("--") must separate the arguments of "vip" from those of the "wp" command.'
|
|
33
|
-
}, {
|
|
34
|
-
usage: `${exampleUsage} --slug=example-site -- wp user list --url=example.example-site.vipdev.lndo.site`,
|
|
35
|
-
description: 'Target the WP-CLI command against the network site "example.example-site.vipdev.lndo.site" of a local multisite environment.'
|
|
36
|
-
}, {
|
|
37
|
-
usage: `${exampleUsage} --slug=example-site -- wp shell`,
|
|
38
|
-
description: 'Run the WP-CLI command "wp shell" against a local environment to open an interactive PHP console.'
|
|
39
|
-
}];
|
|
40
|
-
(0, _command.default)({
|
|
41
|
-
wildcardCommand: true,
|
|
42
|
-
usage
|
|
43
|
-
}).option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, _devEnvironmentCli.processSlug).option('force', 'Skip validation for a local environment to be in a running state.', undefined, _devEnvironmentCli.processBooleanOption).option('quiet', 'Suppress informational messages.', undefined, _devEnvironmentCli.processBooleanOption).examples(examples).argv(process.argv, async (unmatchedArgs, opt) => {
|
|
44
|
-
const slug = await (0, _devEnvironmentCli.getEnvironmentName)(opt, opt.quiet);
|
|
45
|
-
const lando = await (0, _devEnvironmentLando.bootstrapLando)({
|
|
46
|
-
logFile: (0, _devEnvironmentCli.getDevEnvLogFile)(slug),
|
|
47
|
-
quiet: opt.quiet
|
|
48
|
-
});
|
|
49
|
-
(0, _devEnvironmentCli.validateDependencies)(lando);
|
|
50
|
-
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
51
|
-
await (0, _tracker.trackEvent)('dev_env_exec_command_execute', trackingInfo);
|
|
52
|
-
try {
|
|
53
|
-
// to avoid confusion let's enforce -- as a splitter for arguments for this command and wp itself
|
|
54
|
-
const argSplitterIx = process.argv.findIndex(argument => '--' === argument);
|
|
55
|
-
const argSplitterFound = argSplitterIx > -1;
|
|
56
|
-
if (unmatchedArgs.length > 0 && !argSplitterFound) {
|
|
57
|
-
throw new Error('A double dash ("--") must separate the arguments of "vip" from those of the "wp" command. Run "vip dev-env exec --help" for examples.');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** @type {string[]} */
|
|
61
|
-
let arg = [];
|
|
62
|
-
if (argSplitterFound && argSplitterIx + 1 < process.argv.length) {
|
|
63
|
-
arg = process.argv.slice(argSplitterIx + 1);
|
|
23
|
+
if (await (0, dev_environment_lando_1.isEnvUp)(lando, instancePath)) {
|
|
24
|
+
return true;
|
|
64
25
|
}
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
if (!isUp) {
|
|
68
|
-
throw new _userError.default('A WP-CLI command can only be executed on a running local environment.');
|
|
69
|
-
}
|
|
26
|
+
if (attempt >= ENV_UP_CHECK_ATTEMPTS) {
|
|
27
|
+
return false;
|
|
70
28
|
}
|
|
29
|
+
await sleep(ENV_UP_CHECK_DELAY_MS);
|
|
30
|
+
return pollEnvironmentReadiness(lando, instancePath, attempt + 1);
|
|
31
|
+
}
|
|
32
|
+
const examples = [
|
|
33
|
+
{
|
|
34
|
+
usage: `${exampleUsage} --slug=example-site -- wp post list`,
|
|
35
|
+
description: 'Run a WP-CLI command against a local environment named "example-site".\n' +
|
|
36
|
+
' * A double dash ("--") must separate the arguments of "vip" from those of the "wp" command.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
usage: `${exampleUsage} --slug=example-site -- wp user list --url=example.example-site.vipdev.lndo.site`,
|
|
40
|
+
description: 'Target the WP-CLI command against the network site "example.example-site.vipdev.lndo.site" of a local multisite environment.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
usage: `${exampleUsage} --slug=example-site -- wp shell`,
|
|
44
|
+
description: 'Run the WP-CLI command "wp shell" against a local environment to open an interactive PHP console.',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
(0, command_1.default)({
|
|
48
|
+
wildcardCommand: true,
|
|
49
|
+
usage,
|
|
50
|
+
})
|
|
51
|
+
.option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, dev_environment_cli_1.processSlug)
|
|
52
|
+
.option('force', 'Skip validation for a local environment to be in a running state.', undefined, dev_environment_cli_1.processBooleanOption)
|
|
53
|
+
.option('quiet', 'Suppress informational messages.', undefined, dev_environment_cli_1.processBooleanOption)
|
|
54
|
+
.examples(examples)
|
|
55
|
+
.argv(process.argv, async (unmatchedArgs, opt) => {
|
|
56
|
+
const slug = await (0, dev_environment_cli_1.getEnvironmentName)(opt, opt.quiet);
|
|
57
|
+
const lando = await (0, dev_environment_lando_1.bootstrapLando)({ logFile: (0, dev_environment_cli_1.getDevEnvLogFile)(slug), quiet: opt.quiet });
|
|
58
|
+
(0, dev_environment_cli_1.validateDependencies)(lando);
|
|
59
|
+
const trackingInfo = (0, dev_environment_cli_1.getEnvTrackingInfo)(slug);
|
|
60
|
+
await (0, tracker_1.trackEvent)('dev_env_exec_command_execute', trackingInfo);
|
|
71
61
|
try {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
// to avoid confusion let's enforce -- as a splitter for arguments for this command and wp itself
|
|
63
|
+
const argSplitterIx = process.argv.findIndex(argument => '--' === argument);
|
|
64
|
+
const argSplitterFound = argSplitterIx > -1;
|
|
65
|
+
if (unmatchedArgs.length > 0 && !argSplitterFound) {
|
|
66
|
+
throw new Error('A double dash ("--") must separate the arguments of "vip" from those of the "wp" command. Run "vip dev-env exec --help" for examples.');
|
|
67
|
+
}
|
|
68
|
+
/** @type {string[]} */
|
|
69
|
+
let arg = [];
|
|
70
|
+
if (argSplitterFound && argSplitterIx + 1 < process.argv.length) {
|
|
71
|
+
arg = process.argv.slice(argSplitterIx + 1);
|
|
72
|
+
}
|
|
73
|
+
if (!opt.force) {
|
|
74
|
+
const isUp = await waitForEnvironmentReadiness(lando, slug);
|
|
75
|
+
if (!isUp) {
|
|
76
|
+
throw new user_error_1.default('A WP-CLI command can only be executed on a running local environment.');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
await (0, dev_environment_core_1.exec)(lando, slug, arg, { stdio: 'inherit' });
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof user_error_1.default) {
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
// Unfortunately, we are unable to get the exit code from Lando :-(
|
|
87
|
+
process.exitCode = 1;
|
|
88
|
+
}
|
|
89
|
+
await (0, tracker_1.trackEvent)('dev_env_exec_command_success', trackingInfo);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
await (0, dev_environment_cli_1.handleCLIException)(error, 'dev_env_exec_command_error', trackingInfo);
|
|
93
|
+
process.exitCode = 1;
|
|
82
94
|
}
|
|
83
|
-
|
|
84
|
-
} catch (error) {
|
|
85
|
-
await (0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_exec_command_error', trackingInfo);
|
|
86
|
-
process.exitCode = 1;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
95
|
+
});
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
8
|
+
const dev_environment_cli_1 = require("../lib/dev-environment/dev-environment-cli");
|
|
9
|
+
const dev_environment_core_1 = require("../lib/dev-environment/dev-environment-core");
|
|
10
|
+
const tracker_1 = require("../lib/tracker");
|
|
9
11
|
const exampleUsage = 'vip dev-env import media';
|
|
10
12
|
const usage = 'vip dev-env import media';
|
|
11
|
-
const examples = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
await (0,
|
|
26
|
-
|
|
27
|
-
await (0,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
const examples = [
|
|
14
|
+
{
|
|
15
|
+
usage: `${exampleUsage} /Users/example/Desktop/uploads --slug="example-site"`,
|
|
16
|
+
description: 'Import the contents of the "uploads" directory from a path on the user\'s local machine to the "/wp-content/uploads" directory of the local environment named "example-site".',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
(0, command_1.default)({
|
|
20
|
+
requiredArgs: 1,
|
|
21
|
+
usage,
|
|
22
|
+
})
|
|
23
|
+
.examples(examples)
|
|
24
|
+
.option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, dev_environment_cli_1.processSlug)
|
|
25
|
+
.argv(process.argv, async (unmatchedArgs, opt) => {
|
|
26
|
+
const [filePath] = unmatchedArgs;
|
|
27
|
+
const slug = await (0, dev_environment_cli_1.getEnvironmentName)(opt);
|
|
28
|
+
const trackingInfo = (0, dev_environment_cli_1.getEnvTrackingInfo)(slug);
|
|
29
|
+
await (0, tracker_1.trackEvent)('dev_env_import_media_command_execute', trackingInfo);
|
|
30
|
+
try {
|
|
31
|
+
await (0, dev_environment_core_1.importMediaPath)(slug, filePath);
|
|
32
|
+
await (0, tracker_1.trackEvent)('dev_env_import_media_command_success', trackingInfo);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
await (0, dev_environment_cli_1.handleCLIException)(error, 'dev_env_import_media_command_error', trackingInfo);
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -1,56 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const dev_env_import_sql_1 = require("../commands/dev-env-import-sql");
|
|
8
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
9
|
+
const database_1 = require("../lib/database");
|
|
10
|
+
const dev_environment_cli_1 = require("../lib/dev-environment/dev-environment-cli");
|
|
11
|
+
const tracker_1 = require("../lib/tracker");
|
|
10
12
|
const exampleUsage = 'vip dev-env import sql';
|
|
11
13
|
const usage = 'vip dev-env import sql';
|
|
12
|
-
const examples = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
await
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
14
|
+
const examples = [
|
|
15
|
+
{
|
|
16
|
+
usage: `${exampleUsage} /Users/example/Downloads/file.sql --slug="example-site"`,
|
|
17
|
+
description: 'Import the SQL file named "file.sql" from a path on the user\'s local machine to a running local environment named "example-site".',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
usage: `${exampleUsage} /Users/example/Downloads/file.sql --search-replace="example-site.com,example-site.vipdev.lndo.site" --slug="example-site"`,
|
|
21
|
+
description: 'Search for the string "example-site.com" in the SQL file and replace it with "example-site.vipdev.lndo.site" during the import.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
usage: `${exampleUsage} /Users/example/Downloads/file.sql --search-replace="example-site.com,example-site.vipdev.lndo.site" --skip-reindex --slug="example-site"`,
|
|
25
|
+
description: 'Import the SQL file to a local environment with Elasticsearch enabled, and do not reindex after the import is completed.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
usage: `${exampleUsage} /Users/example/Downloads/file.sql --search-replace="example-site.com,example-site.vipdev.lndo.site" --in-place`,
|
|
29
|
+
description: 'Perform the search and replace operation on the local SQL file ("file.sql"), save the changes, and import the updated file to the local environment.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
usage: `${exampleUsage} /Users/example/Downloads/file.sql --search-replace="example-site.com/site-three,site-three.example-site.vipdev.lndo.site" --search-replace="example-site.com,example-site.vipdev.lndo.site" --slug="example-site"`,
|
|
33
|
+
description: 'Search and replace 2 pairs of strings during the import of the SQL file to a local multisite environment.',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
(0, command_1.default)({
|
|
37
|
+
requiredArgs: 1,
|
|
38
|
+
usage,
|
|
39
|
+
})
|
|
40
|
+
.option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, dev_environment_cli_1.processSlug)
|
|
41
|
+
.option(['r', 'search-replace'], 'Search for a string in the SQL file and replace it with a new string.')
|
|
42
|
+
.option('in-place', 'Perform a search and replace operation on the local SQL file and save the results.')
|
|
43
|
+
.option('skip-validate', 'Skip file validation.')
|
|
44
|
+
.option(['k', 'skip-reindex'], 'Skip Elasticsearch reindex after import.')
|
|
45
|
+
.option('quiet', 'Skip confirmation and suppress informational messages.')
|
|
46
|
+
.examples(examples)
|
|
47
|
+
.argv(process.argv, async (unmatchedArgs, opt) => {
|
|
48
|
+
const [fileName] = unmatchedArgs;
|
|
49
|
+
const slug = await (0, dev_environment_cli_1.getEnvironmentName)(opt, opt.quiet);
|
|
50
|
+
if (opt.searchReplace && !Array.isArray(opt.searchReplace)) {
|
|
51
|
+
opt.searchReplace = [opt.searchReplace];
|
|
52
|
+
}
|
|
53
|
+
const cmd = new dev_env_import_sql_1.DevEnvImportSQLCommand(fileName, opt, slug);
|
|
54
|
+
const dumpDetails = await (0, database_1.getSqlDumpDetails)(fileName);
|
|
55
|
+
const trackingInfo = (0, dev_environment_cli_1.getEnvTrackingInfo)(cmd.slug);
|
|
56
|
+
const trackerFn = (0, tracker_1.makeCommandTracker)('dev_env_import_sql', {
|
|
57
|
+
...trackingInfo,
|
|
58
|
+
sqldump_type: dumpDetails.type,
|
|
53
59
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
await trackerFn('execute');
|
|
61
|
+
try {
|
|
62
|
+
await cmd.run();
|
|
63
|
+
await trackerFn('success');
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
await (0, dev_environment_cli_1.handleCLIException)(error);
|
|
67
|
+
await trackerFn('error', { message: error.message, stack: error.stack });
|
|
68
|
+
process.exitCode = 1;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
6
8
|
const exampleUsage = 'vip dev-env import';
|
|
7
9
|
const usage = 'vip dev-env import';
|
|
8
|
-
const examples = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const examples = [
|
|
11
|
+
{
|
|
12
|
+
usage: `${exampleUsage} sql /Users/example/Downloads/file.sql`,
|
|
13
|
+
description: 'Import the SQL file named "file.sql" from a path on the user\'s local machine to a running local environment.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
usage: `${exampleUsage} media /Users/example/Desktop/uploads`,
|
|
17
|
+
description: 'Import the contents of the "uploads" directory from a path on the user\'s local machine to the "/wp-content/uploads" directory of a running local environment.',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
(0, command_1.default)({
|
|
21
|
+
requiredArgs: 1,
|
|
22
|
+
usage,
|
|
23
|
+
})
|
|
24
|
+
.examples(examples)
|
|
25
|
+
.command('sql', 'Import a SQL file to a running local environment.')
|
|
26
|
+
.command('media', 'Import media files to a running local environment.')
|
|
27
|
+
.argv(process.argv);
|
|
@@ -1,56 +1,65 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
9
|
+
const dev_environment_cli_1 = require("../lib/dev-environment/dev-environment-cli");
|
|
10
|
+
const dev_environment_core_1 = require("../lib/dev-environment/dev-environment-core");
|
|
11
|
+
const dev_environment_lando_1 = require("../lib/dev-environment/dev-environment-lando");
|
|
12
|
+
const tracker_1 = require("../lib/tracker");
|
|
13
|
+
const debug = (0, debug_1.default)('@automattic/vip:bin:dev-environment');
|
|
12
14
|
const exampleUsage = 'vip dev-env info';
|
|
13
15
|
const usage = 'vip dev-env info';
|
|
14
|
-
const examples = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
const lando = await (0, _devEnvironmentLando.bootstrapLando)({
|
|
36
|
-
logFile: (0, _devEnvironmentCli.getDevEnvLogFile)(slug)
|
|
37
|
-
});
|
|
38
|
-
(0, _devEnvironmentCli.validateDependencies)(lando);
|
|
39
|
-
await (0, _tracker.trackEvent)('dev_env_info_command_execute', trackingInfo);
|
|
40
|
-
debug('Args: ', arg, 'Options: ', opt);
|
|
41
|
-
try {
|
|
42
|
-
const options = {
|
|
43
|
-
extended: true,
|
|
44
|
-
suppressWarnings: true
|
|
45
|
-
};
|
|
16
|
+
const examples = [
|
|
17
|
+
{
|
|
18
|
+
usage: `${exampleUsage} --slug=example-site`,
|
|
19
|
+
description: 'Retrieve information about the local environment named "example-site".',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
usage: `${exampleUsage} --all`,
|
|
23
|
+
description: 'Retrieve information about all local environments.',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
(0, command_1.default)({
|
|
27
|
+
usage,
|
|
28
|
+
})
|
|
29
|
+
.option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, dev_environment_cli_1.processSlug)
|
|
30
|
+
.option('all', 'Retrieve information about all local environments.')
|
|
31
|
+
.option('extended', 'Deprecated, not used.')
|
|
32
|
+
.examples(examples)
|
|
33
|
+
.argv(process.argv, async (arg, opt) => {
|
|
34
|
+
let trackingInfo;
|
|
35
|
+
let slug;
|
|
46
36
|
if (opt.all) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
await (0, _devEnvironmentCore.printEnvironmentInfo)(lando, slug, options);
|
|
37
|
+
trackingInfo = { all: true };
|
|
38
|
+
slug = undefined;
|
|
50
39
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
else {
|
|
41
|
+
slug = await (0, dev_environment_cli_1.getEnvironmentName)(opt);
|
|
42
|
+
trackingInfo = (0, dev_environment_cli_1.getEnvTrackingInfo)(slug);
|
|
43
|
+
}
|
|
44
|
+
const lando = await (0, dev_environment_lando_1.bootstrapLando)({ logFile: (0, dev_environment_cli_1.getDevEnvLogFile)(slug) });
|
|
45
|
+
(0, dev_environment_cli_1.validateDependencies)(lando);
|
|
46
|
+
await (0, tracker_1.trackEvent)('dev_env_info_command_execute', trackingInfo);
|
|
47
|
+
debug('Args: ', arg, 'Options: ', opt);
|
|
48
|
+
try {
|
|
49
|
+
const options = {
|
|
50
|
+
extended: true,
|
|
51
|
+
suppressWarnings: true,
|
|
52
|
+
};
|
|
53
|
+
if (opt.all) {
|
|
54
|
+
await (0, dev_environment_core_1.printAllEnvironmentsInfo)(lando, options);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
await (0, dev_environment_core_1.printEnvironmentInfo)(lando, slug, options);
|
|
58
|
+
}
|
|
59
|
+
await (0, tracker_1.trackEvent)('dev_env_info_command_success', trackingInfo);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
await (0, dev_environment_cli_1.handleCLIException)(error, 'dev_env_info_command_error', trackingInfo);
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const command_1 = __importDefault(require("../lib/cli/command"));
|
|
8
|
+
const dev_environment_cli_1 = require("../lib/dev-environment/dev-environment-cli");
|
|
9
|
+
const dev_environment_core_1 = require("../lib/dev-environment/dev-environment-core");
|
|
10
|
+
const dev_environment_lando_1 = require("../lib/dev-environment/dev-environment-lando");
|
|
11
|
+
const tracker_1 = require("../lib/tracker");
|
|
10
12
|
const exampleUsage = 'vip dev-env list';
|
|
11
13
|
const usage = 'vip dev-env list';
|
|
12
|
-
const examples = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
14
|
+
const examples = [
|
|
15
|
+
{
|
|
16
|
+
usage: `${exampleUsage}`,
|
|
17
|
+
description: 'Retrieve basic information about all local environments.',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
(0, command_1.default)({
|
|
21
|
+
usage,
|
|
22
|
+
})
|
|
23
|
+
.examples(examples)
|
|
24
|
+
.argv(process.argv, async () => {
|
|
25
|
+
const lando = await (0, dev_environment_lando_1.bootstrapLando)({ logFile: (0, dev_environment_cli_1.getDevEnvLogFile)() });
|
|
26
|
+
lando.events.constructor.prototype.setMaxListeners(1024);
|
|
27
|
+
(0, dev_environment_cli_1.validateDependencies)(lando);
|
|
28
|
+
const trackingInfo = { all: true };
|
|
29
|
+
await (0, tracker_1.trackEvent)('dev_env_list_command_execute', trackingInfo);
|
|
30
|
+
try {
|
|
31
|
+
await (0, dev_environment_core_1.printAllEnvironmentsInfo)(lando, {});
|
|
32
|
+
await (0, tracker_1.trackEvent)('dev_env_list_command_success', trackingInfo);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
await (0, dev_environment_cli_1.handleCLIException)(error, 'dev_env_list_command_error', trackingInfo);
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
}
|
|
38
|
+
});
|