* Try and detect the installation method for Yarn and provide a command to update it with.
(installationMethod)
| 6202 | */ |
| 6203 | |
| 6204 | function 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 | |
| 6240 | function getUpdateInstaller(installationMethod) { |
| 6241 | // Windows |
no test coverage detected