From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b6714f17 for ; Wed, 18 Sep 2019 22:30:25 +0000 (UTC) Received: (qmail 26765 invoked by alias); 18 Sep 2019 22:30:19 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24263 Received: (qmail 28999 invoked by uid 1010); 18 Sep 2019 22:30:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25573. spamassassin: 3.4.2. Clear:RC:0(209.85.217.54):SA:0(-2.0/5.0):. Processed in 3.699261 secs); 18 Sep 2019 22:30:18 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.54 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6BV0InM71LGaxA64c8BJXzr5IP+5cg0k6Jlcx910q3Y=; b=bGkC/9PM3ecMORhrlEmXaP8+r+BjgVpxLwGC5yEVwJQhW+g7ohWOWsLjf9ho3n8RPM MeCwO7YKY3hx8pZ7t5eTsVJb4QvJBw4LvFb7bJR9CVhpiXVydGeyj8wdKKX3mFE7dvOP 68FVwzN+JtcFYtBF7kCqmY9IBV8aJiVmhaUm7cwbckEEttoJg612JDvOOkc+DY9RqJZ0 kElP9PYVdXR7cujS3BMfGtJkGOWqxWw1DtlCY9eCjSZRqKP/pGgIUpqGz9w9WafjElgt Y5BYGbcJuuUv6A+SmoBMPqezEh1YVLM3+NH0++fpS7WWa1AV0ZRV7XGbJkJqC93gOnA3 VOOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6BV0InM71LGaxA64c8BJXzr5IP+5cg0k6Jlcx910q3Y=; b=Zdbr7XxFmlcYZ/vZlvpWPVn3lWs8YlQ2IqX74S+EVecPao9dVzab6IzNxPJjfixx73 t+nsX3qRL06gninaHGFv7rlH2MzWbAOUH8hzXNCEyl2SjFFpgQp74wWV5yBcpchjNoFB /+wcuvf2IHJXkLLLcRjy3yuOI0HE1R76VfVYX5sKGcIhSaL6ACbWFrm6c6dGSOKhkLIu n0YxJOuhIg18VYS1ZXEvuprIkD/MzI+Ehcr6IZg6DgmErwpK/krtH/XFHE8BpO9dl4hC u1/VNbxLN4oNgPphO7943Awu0UVkz9FjqkckELaIPISYEF5pD9dlO7s6BTJ0+5XxHmOV O+Iw== X-Gm-Message-State: APjAAAUOm/0hiF9a0FDn0/U8SHXeF/Ai1RYm3RErq2lBsf+BMYF2NvTj W0CMdPXBdLJuyQw891Axp9j4EnynMwgAaBFKtLyimA+vzuw= X-Google-Smtp-Source: APXvYqwA09k/pHZhKkvePyH47jXHD133GIgULuMDvVA1M3PPaavhP85D0MbP2T8xHDtOk7iNhfFV0f+jsU+Zs0apkig= X-Received: by 2002:a67:70c7:: with SMTP id l190mr3708094vsc.147.1568845781567; Wed, 18 Sep 2019 15:29:41 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Thu, 19 Sep 2019 00:27:30 +0200 Message-ID: Subject: A new Zplugin extension that exposes binaries To: Zsh Users Content-Type: text/plain; charset="UTF-8" Hello, normally, when one wants to gain access to execute a script/program, he copies it to the PATH or adds its directory to the PATH. There is however a different method: to create a function of the same name as the binary with the path to it embedded inside the function. One other method is to create a "forwarder"-script (rbenv calls such scripts `shims') and copy it to the single, possibly dedicated PATH entry. The zplugin extension does this automatically. Example function created: asciidoctor () { local bindir="/home/sg/.zplugin/plugins/zdharma---null/bin" local -x GEM_HOME="/home/sg/.zplugin/plugins/zdharma---null" "$bindir"/"asciidoctor" "$@" } As it can be seen the extension can also install gems and automatically export GEM_HOME (plus the same for Node, and some other features). You can check it out at: https://github.com/zplugin/z-a-bin-gem-node -- Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org