# Run pathman to set up the folder
#& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\bin"
-& "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\bin
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\bin
{{ installer }}
# Run pathman to set up the folder
#& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\bin"
-& "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\bin
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\bin
# {{ baseurl }}
# {{ version }}
--- /dev/null
+#!/usr/bin/env pwsh
+
+$pkg_cmd_name = "git"
+$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
+
+$pkg_src = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name-v$Env:WEBI_VERSION"
+
+$pkg_dst = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name"
+$pkg_dst_cmd = "$pkg_dst\cmd\$pkg_cmd_name"
+$pkg_dst_bin = "$pkg_dst\cmd"
+
+# Fetch archive
+IF (!(Test-Path -Path "$pkg_download"))
+{
+ # TODO: arch detection
+ echo "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $pkg_download"
+ & curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
+ & move "$pkg_download.part" "$pkg_download"
+}
+
+IF (!(Test-Path -Path "$pkg_src"))
+{
+ echo "Installing $pkg_cmd_name"
+ # TODO: temp directory
+
+ # Enter opt
+ ($none = pushd .local\tmp) | out-null
+
+ # Remove any leftover tmp cruft
+ Remove-Item -Path "$pkg_cmd_name*" -Recurse -ErrorAction Ignore
+
+ # Unpack archive
+ # Windows BSD-tar handles zip. Imagine that.
+ echo "Unpacking $pkg_download"
+ IF (!(Test-Path -Path "$pkg_cmd_name-v$Env:WEBI_VERSION")) {
+ New-Item -Path "$pkg_cmd_name-v$Env:WEBI_VERSION" -ItemType Directory
+ }
+ ($none = pushd "$pkg_cmd_name-v$Env:WEBI_VERSION") | out-null
+ & tar xf "$pkg_download"
+ ($none = popd) | out-null
+
+ # Settle unpacked archive into place
+ echo "New Name: $pkg_cmd_name-v$Env:WEBI_VERSION"
+ echo "New Location: $pkg_src"
+ Move-Item -Path "$pkg_cmd_name-v$Env:WEBI_VERSION" -Destination "$Env:USERPROFILE\.local\opt"
+
+ # Exit tmp
+ $none = popd
+}
+
+echo "Copying into '$pkg_dst' from '$pkg_src'"
+Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
+Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
+
+# Add to path
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\opt\git\cmd
--- /dev/null
+#!/bin/bash
+{
+ set -e
+ set -u
+
+ echo "This package doesn't work for Mac or Linux yet - only Windows 10"
+ exit 1
+}
--- /dev/null
+'use strict';
+
+var github = require('../_common/github.js');
+var owner = 'git-for-windows';
+var repo = 'git';
+
+module.exports = function (request) {
+ // TODO support mac and linux tarballs
+ return github(request, owner, repo).then(function (all) {
+ // See https://github.com/git-for-windows/git/wiki/MinGit
+ // also consider https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation
+ all.releases = all.releases
+ .filter(function (rel) {
+ rel.os = 'windows';
+ return (
+ /MinGit/i.test(rel.name || rel.download) &&
+ !/busybox/i.test(rel.name || rel.download)
+ );
+ })
+ .slice(0, 20);
+ return all;
+ });
+};
+
+if (module === require.main) {
+ module.exports(require('@root/request')).then(function (all) {
+ all = require('../_webi/normalize.js')(all);
+ console.info(JSON.stringify(all, null, 2));
+ });
+}
--- /dev/null
+#!/usr/bin/env pwsh
+
+$pkg_cmd_name = "go"
+$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
+
+$pkg_src = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name-v$Env:WEBI_VERSION"
+
+$pkg_dst = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name"
+$pkg_dst_cmd = "$pkg_dst\bin\$pkg_cmd_name"
+$pkg_dst_bin = "$pkg_dst\bin"
+
+# Fetch archive
+IF (!(Test-Path -Path "$pkg_download"))
+{
+ # TODO: arch detection
+ echo "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $pkg_download"
+ & curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
+ & move "$pkg_download.part" "$pkg_download"
+}
+
+IF (!(Test-Path -Path "$pkg_src"))
+{
+ echo "Installing $pkg_cmd_name"
+ # TODO: temp directory
+
+ # Enter opt
+ pushd .local\tmp
+
+ # Remove any leftover tmp cruft
+ Remove-Item -Path "$pkg_cmd_name*" -Recurse -ErrorAction Ignore
+
+ # Unpack archive
+ # Windows BSD-tar handles zip. Imagine that.
+ echo "Unpacking $pkg_download"
+ & tar xf "$pkg_download"
+
+ # Settle unpacked archive into place
+ echo "New Name: $pkg_cmd_name-v$Env:WEBI_VERSION"
+ Get-ChildItem "$pkg_cmd_name*" | Select -f 1 | Rename-Item -NewName "$pkg_cmd_name-v$Env:WEBI_VERSION"
+ echo "New Location: $pkg_src"
+ Move-Item -Path "$pkg_cmd_name-v$Env:WEBI_VERSION" -Destination "$Env:USERPROFILE\.local\opt"
+
+ # Exit tmp
+ popd
+}
+
+echo "Copying into '$pkg_dst' from '$pkg_src'"
+Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
+Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
+
+# Special to go: re-run all go tooling builds
+echo "Building go language tools..."
+echo gopls
+& "$pkg_dst_cmd" get golang.org/x/tools/gopls
+echo golint
+& "$pkg_dst_cmd" get golang.org/x/lint/golint
+echo errcheck
+& "$pkg_dst_cmd" get github.com/kisielk/errcheck
+echo gotags
+& "$pkg_dst_cmd" get github.com/jstemmer/gotags
+echo goimports
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/goimports
+echo gorename
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gorename
+echo gotype
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype
+echo stringer
+& "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer
+
+# Add to path
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\opt\go\bin
+
+# Special to go: add default GOBIN to PATH
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\go\bin
echo "Building go language tools..."
echo gopls
"$pkg_dst_cmd" get golang.org/x/tools/gopls > /dev/null #2>/dev/null
+ echo golint
+ "$pkg_dst_cmd" get golang.org/x/lint/golint > /dev/null #2>/dev/null
+ echo errcheck
+ "$pkg_dst_cmd" get github.com/kisielk/errcheck > /dev/null #2>/dev/null
echo gotags
"$pkg_dst_cmd" get github.com/jstemmer/gotags > /dev/null #2>/dev/null
echo goimports
& .\.local\opt\node\npm.cmd --scripts-prepend-node-path=true config set scripts-prepend-node-path true
# Add to path
-& "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\opt\node
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add '%USERPROFILE\.local\opt\node'
--- /dev/null
+---
+title: vim-go
+homepage: https://github.com/fatih/vim-go
+tagline: |
+ vim-go adds Go language support for Vim.
+description: |
+ `vim-go` provides integration with various official and 3rd part go tooling for linting, vetting, etc.
+
+ You'll also need `syntastic` or similar.
+---
+
+### How to install by hand
+
+```bash
+git clone --depth=1 https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
+```
+
+### How to configure your `.vimrc`
+
+```vimrc
+" don't check syntax immediately on open or on quit
+let g:syntastic_check_on_open = 1
+let g:syntastic_check_on_wq = 0
+
+" we also want to get rid of accidental trailing whitespace on save
+autocmd BufWritePre * :%s/\s\+$//e
+```
+
+```vimrc
+"""""""""""""""""""""""""""
+" Golang-specific options "
+"""""""""""""""""""""""""""
+
+" tell syntastic that go, golint, and errcheck are installed
+let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
+
+" tell vim-go that goimports is installed
+let g:go_fmt_command = "goimports"
+
+" tell vim-go to highlight
+let g:go_highlight_functions = 1
+let g:go_highlight_methods = 1
+let g:go_highlight_structs = 1
+let g:go_highlight_operators = 1
+let g:go_highlight_build_constraints = 1
+```
+
+### How to install go language tools
+
+```bash
+# gopls
+go get golang.org/x/tools/gopls
+
+# golint
+go get golang.org/x/lint/golint
+
+# errcheck
+go get github.com/kisielk/errcheck
+
+# gotags
+go get github.com/jstemmer/gotags
+
+# goimports
+go get golang.org/x/tools/cmd/goimports
+
+# gorename
+go get golang.org/x/tools/cmd/gorename
+
+# gotype
+go get golang.org/x/tools/cmd/gotype
+```
--- /dev/null
+#!/usr/bin/env pwsh
+
+Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\vim-go" -Recurse -ErrorAction Ignore
+& git clone --depth=1 https://github.com/fatih/vim-go.git "$Env:USERPROFILE\.vim\pack\plugins\start\vim-go"
--- /dev/null
+#!/bin/bash
+
+{
+ set -e
+ set -u
+
+ rm -rf "$HOME/.vim/pack/plugins/start/vim-go"
+ git clone --depth=1 https://github.com/fatih/vim-go.git "$HOME/.vim/pack/plugins/start/vim-go"
+}