diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | envy.sh | 37 |
4 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..49ba3f253fae --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = envy + pkgdesc = Shell helper that automatically sets and unsets environment variables + pkgver = 0.1.0 + pkgrel = 1 + url = https://github.com/wojas/envy + arch = i686 + arch = x86_64 + license = MIT + makedepends = go + options = !strip + options = !emptydirs + source = https://github.com/wojas/envy/archive/v0.1.0.tar.gz + source = envy.sh + sha256sums = f679cd32168db3d748464383f41a6a362124660bc8c230d6314de2f852326812 + sha256sums = b2581587b19848f0d3d6dfce4871fe6abcb57fd207f7d39a0ae171835bada862 + +pkgname = envy + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..2e1f87bea911 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +envy-*.pkg.tar.xz +pkg/ +src/ +v*.tar.gz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8a38adceccde --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: Pieter Lexis <pieter+AUR@plexis.eu> + +pkgname=envy +pkgver=0.1.0 +pkgrel=1 +pkgdesc="Shell helper that automatically sets and unsets environment variables" +arch=('i686' 'x86_64') +options=('!strip' '!emptydirs') +url="https://github.com/wojas/envy" +license=('MIT') +depends=() +makedepends=('go') +source=(https://github.com/wojas/envy/archive/v${pkgver}.tar.gz + $pkgname.sh) +sha256sums=('f679cd32168db3d748464383f41a6a362124660bc8c230d6314de2f852326812' + 'b2581587b19848f0d3d6dfce4871fe6abcb57fd207f7d39a0ae171835bada862') + +prepare() { + cd "$pkgname-$pkgver" + + GOPATH=`pwd` go get -d -v +} + +build() { + cd "$pkgname-$pkgver" + + GOPATH=`pwd` go build +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm755 "$pkgname-$pkgver" "$pkgdir/usr/bin/$pkgname" + install -Dm644 "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" + + cd .. + install -Dm644 "$pkgname.sh" "$pkgdir/etc/profile.d/$pkgname.sh" +} + +# vim:set ts=2 sw=2 et: diff --git a/envy.sh b/envy.sh new file mode 100644 index 000000000000..864de7995cd4 --- /dev/null +++ b/envy.sh @@ -0,0 +1,37 @@ +# Copyright © 2018 Pieter Lexis <pieter+AUR@plexis.eu> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +ENVY_BIN='/usr/bin/envy' + +# Not bash or zsh? +[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0 + +# Not an interactive shell? +[[ $- == *i* ]] || return 0 + +# Do we have envy? +[ -r "${ENVY_BIN}" ] || return 0 + +__envy_session_command() { + eval $("${ENVY_BIN}" session) +} + +[ -n "$BASH_VERSION" ] && PROMPT_COMMAND="__envy_session_command" +[ -n "$ZSH_VERSION" ] && precmd_functions+=(__envy_session_command) |