Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended to integrate scoop #110

Closed
star2000 opened this issue Aug 20, 2019 · 2 comments
Closed

Recommended to integrate scoop #110

star2000 opened this issue Aug 20, 2019 · 2 comments

Comments

@star2000
Copy link
Contributor

Use scoop to install app and control version is a good idea.

@star2000
Copy link
Contributor Author

star2000 commented Oct 2, 2019

Here are some powershell codes for reference.

function Get-ScoopAppName ([Parameter(Mandatory)] $Name) {
    $alias = @{
        'sublime'   = 'sublime-text'
        'code'      = 'vscode'
        'notepad++' = 'notepadplusplus'
        'mysql'     = 'mariadb'
    }
    if ($alias.ContainsKey($Name)) {
        return $alias.$Name
    }
    else {
        return $Name
    }
}

function Install-LaragonApp ([Parameter(Mandatory)] $Name) {
    scoop install (Get-ScoopAppName($Name))

    Remove-Item "C:\laragon\bin\$Name" -Recurse -Force -ErrorAction Ignore

    $appDir = scoop prefix (Get-ScoopAppName($Name))

    if ($Name -in 'apache', 'memcached', 'mongodb', 'mysql', 'nginx', 'nodejs', 'php', 'python', 'redis') {
        $appDir = Split-Path $appDir
    }

    New-Item "C:\laragon\bin\$Name" -ItemType Junction -Value $appDir
}

function Uninstall-LaragonApp ([Parameter(Mandatory)] $Name) {
    scoop uninstall (Get-ScoopAppName($Name))

    Remove-Item "C:\laragon\bin\$Name" -Recurse -Force -ErrorAction Ignore
}

For example:

Install-LaragonApp nginx

@star2000
Copy link
Contributor Author

star2000 commented Oct 13, 2019

see https://github.com/star2000/laragon to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant