This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 201
class ShopifyCli::JsDeps
Tim Anema edited this page Jul 21, 2020
·
4 revisions
ShopifyCli::JsDeps ensures that all JavaScript dependencies are installed for projects.
install(ctx, verbose = false)
Proxy to instance method ShopifyCli::JsDeps.new.install.
-
ctx
: running context from your command -
verbose
: whether to run the installation tools in silent mode
ShopifyCli::JsDeps.install(ctx)
see source
# File lib/shopify-cli/js_deps.rb, line 24
def self.install(ctx, verbose = false)
new(ctx: ctx).install(verbose)
end
install(verbose = false)
Installs all of a project's JavaScript dependencies using Yarn or NPM, based
on the project's settings.
-
verbose
: whether to run the installation tools in silent mode
# context is the running context for the command
ShopifyCli::JsDeps.new(context).install(true)
see source
# File lib/shopify-cli/js_deps.rb, line 39
def install(verbose = false)
title = ctx.message('core.js_deps.installing', @system.package_manager)
success = ctx.message('core.js_deps.installed')
failure = ctx.message('core.js_deps.error.install_error', @system.package_manager)
CLI::UI::Frame.open(title, success_text: success, failure_text: failure) do
@system.call(
yarn: -> { yarn(verbose) },
npm: -> { npm(verbose) }
)
end
end
- SmartProperties