MCPcopy
hub / github.com/vercel/hyper / getUpdateCommand

Function getUpdateCommand

bin/yarn-standalone.js:6204–6238  ·  view source on GitHub ↗

* Try and detect the installation method for Yarn and provide a command to update it with.

(installationMethod)

Source from the content-addressed store, hash-verified

6202 */
6203
6204function getUpdateCommand(installationMethod) {
6205 if (installationMethod === 'tar') {
6206 return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`;
6207 }
6208
6209 if (installationMethod === 'homebrew') {
6210 return 'brew upgrade yarn';
6211 }
6212
6213 if (installationMethod === 'deb') {
6214 return 'sudo apt-get update && sudo apt-get install yarn';
6215 }
6216
6217 if (installationMethod === 'rpm') {
6218 return 'sudo yum install yarn';
6219 }
6220
6221 if (installationMethod === 'npm') {
6222 return 'npm install --global yarn';
6223 }
6224
6225 if (installationMethod === 'chocolatey') {
6226 return 'choco upgrade yarn';
6227 }
6228
6229 if (installationMethod === 'apk') {
6230 return 'apk update && apk add -u yarn';
6231 }
6232
6233 if (installationMethod === 'portage') {
6234 return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn';
6235 }
6236
6237 return null;
6238}
6239
6240function getUpdateInstaller(installationMethod) {
6241 // Windows

Callers 1

_checkUpdateMethod · 0.85

Calls 1

_load_constantsFunction · 0.85

Tested by

no test coverage detected