xtendo-org / chips Goto Github PK
View Code? Open in Web Editor NEWA fast, lightweight, and concurrent plugin manager for the fish shell, written in Haskell
A fast, lightweight, and concurrent plugin manager for the fish shell, written in Haskell
The rate of unauthenticated requests to GitHub is limited to 60 per hour. This means with 10 plugins you can't run chips
more than six times in an hour.
The next chips release will be HUGE, because it'll shipped with the PR #25 being merged. Which means, the next release of chips will support Ubuntu 14.04 LTS.
I have serious problem building chips in my own hand because of commercialhaskell/stack#2780. Someone please upload the latest pre-built chips binary in this issue. Thanks!
Please specity your target triple when you upload your own binary. Example:
You should specify distribution version if you're uploading darwin binary.
In some reason, uploaded chips 1.1.0 says that its version is 1.0.0. This might be a clue to fix this bug.
chips: fish plugin manager
version 1.0.0
https://github.com/xtendo-org/chips/blob/master/src/SelfUpdate.hs#L67
runUpdate repo tag assetName path = getAsset >>= \case
Right bin -> bracket topen hClose $ \ h -> do
B.hPut h bin
hClose h
rename tmpPath path
return $ Right tag
Left err -> return $ Left err
Maybe we should call chmod +x path
thing after rename tmpPath path
Some plugins have important jobs to do before being deleted. OMF does source uninstall.fish
before deletion and some plugins are depends on that behavior. Shall we?
When a user tries to update/install plugins without internet connection, something like this happens:
chips: fish plugin manager
version 1.0.0
Checking update for theme-bobthefish...
Checking update for fish-sensible...
Failed checking update for fish-sensible.
Failed checking update for theme-bobthefish.
Build result saved at /Users/nobell/.config/chips/build.fish
As (failed) build result is saved at build.fish
, it deletes (some of) existing plugins. For this case, theme-bobthefish
survived but fish-sensible
didn't. Maybe just popping out the error message and doing nothing (or just prune unused plugins) when offline would do the trick?
Would this lib be useful in getting autocompletion of commands?
The example for this being typing chips
and then hitting [TAB]
would then give a prompt out to the shell for the commands available. This would in theory also allow if you type chips l
to autocomplete to chips list
or to give the possible commands from the query.
https://github.com/mbrubeck/compleat
Just found this project and looks awesome. Great that this is a binary distribution.
Currently running chips is not sufficient to update the plugin system; it doesn't load the new plugins to the current fish shell which ran chips. The shell will remain unchanged.
Let's say the desired use-case scenario is that the user types chips
, then the install/update takes place, and the current shell is loaded with the latest configuration and plugins. This means:
exec*
family of functions to replace itself with fish.exec chips
, not just chips
.So, we need to add, at the end of the chips source code, a line that calls exec*
. Then, in the build.fish
file, something like below:
alias chips "exec ~/.local/bin/chips"
Alternatively, we can simply drop the line below in build.fish
:
alias chips "~/.local/bin/chips; exec fish"
If I run chips without making ~/.config/fish/functions
directory, it throws an exception.
$ ./chips
chips: fish plugin manager
version 1.0.0
Build result saved at /home/simnalamburt/.config/chips/build.fish
chips: /home/iioopp90/.config/fish/functions: copyFile: does not exist (No such file or directory)
Similar issue with #11
Normally this is impossible; the release version would always be higher than the local version. But during the development, this could quite often be true.
This is issue is a version blocker. We can't release the next version without resolving this, because we won't be able to roll out RCs (or anything that's not the next stable version, for that matter).
Perhaps we should use semver.
Chips is awesome! I want to spread this program to various platforms.
For POSIX platforms
#!/bin/bash
# Requirements: libgmp git stack strip upx zip
export TARGET="x86_64-linux" && \
git clone https://github.com/xtendo-org/chips.git --depth=1 --branch=1.1.2 && \
cd chips && \
stack setup && \
stack build && \
cp .stack-work/install/"$TARGET"/nightly-2016-10-29/8.0.1/bin/chips chips-"$TARGET" && \
strip --strip-all --remove-section=.comment --remove-section=.note chips-"$TARGET" && \
upx -9 --lzma chips-"$TARGET" && \
zip chips-"$TARGET".zip chips-"$TARGET" && \
rm chips-"$TARGET"
For macOS
#!/bin/bash
# Requirements: libgmp git stack strip upx zip
export TARGET="x86_64-osx" && \
git clone https://github.com/xtendo-org/chips.git --depth=1 --branch=1.1.2 && \
cd chips && \
stack setup && \
stack build && \
cp .stack-work/install/"$TARGET"/nightly-2016-10-29/8.0.1/bin/chips chips-"$TARGET" && \
strip -u -r chips-"$TARGET" && \
upx -9 --lzma chips-"$TARGET" && \
zip chips-"$TARGET".zip chips-"$TARGET" && \
rm chips-"$TARGET"
I get the following error when trying to run chips
on the macOS Sierra public beta:
fish: 'chips' terminated by signal SIGKILL (Forced quit)
When chips is executed with the --version
argument, it turns off the parent fish shell.
I want this.
Related:
Lines 53 to 58 in 5484641
First, yes I still use chips, and second, HTTP header name is case-insensitive. Don't know why but after HTTP/2, many web pages started to just use lowercase for all HTTP header names, including GitHub:
$ curl -I https://github.com/xtendo-org/chips/releases/latest
HTTP/2 302
server: GitHub.com
date: Fri, 31 Mar 2023 10:59:48 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
location: https://github.com/xtendo-org/chips/releases/tag/1.1.2
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
(...)
Haskell's best networking library, readProcess "curl"
, has -w/--write-out <format>
option to give some variables:
curl -w '%{redirect_url}' https://github.com/xtendo-org/chips/releases/latest
Or, if you prefer another way:
curl -w '%header{location}' https://github.com/xtendo-org/chips/releases/latest
Some thought needed on how best to handle this.
It'd be cool if there were a chips config that uses Nix, like this nix config for oh-my-zsh. That way, nix users could just write a line in their nix config, (as in this oh-my-zsh nix config), and that would automatically configure everything with the right plugins.
Since no other fish plugin managers are built into Nix yet, this would give Chips an edge over the others.
Windows Subsystem for Linux should be compatible with unmodified Linux executables, but Chips doesn't work:
Failed to execute process '/home/sargun/.local/bin/chips'. Reason:
exec: Exec format error
The file '/home/sargun/.local/bin/chips' is marked as an executable but could not be run by the operating system.
Additionally, install from source doesn't work due to this WSL bug: microsoft/WSL#307
chips depends on the commands git
and curl
. Therefore, it should first check for their existence, and print an error message if they're not available.
Both are not part of the POSIX standard. Although curl
is included in nearly all GNU/Linux distros and OS X, git
obviously isn't. I've never seen a user desktop operating system which ships with it by default.
One of the killer features of chips is that you can use chips with just one binary, without any runtime or dependencies. So let's make an automated build system with CI services and give users a link for chips!
If I run chips without making ~/.config/fish/config.fish
, it throws an exception.
$ ./chips
chips: fish plugin manager
version 1.0.0
Build result saved at /home/simnalamburt/.config/chips/build.fish
chips: /home/simnalamburt/.config/fish/config.fish: openBinaryFile: does not exist (No such file or directory)
if config.fish
doesn't exist, I think making new config.fish
and injecting chips codes would be an agreeable default behavior. How do you think?
Current implementation just injects the line to the config.fish below:
# chips (don't touch the line below!)
if [ -e ~/.config/chips/build.fish ] ; source ~/.config/chips/build.fish ; end
And current implementation seems to be assuming that chips executable file is located at ~/.local/bin/chips
-- https://github.com/kinoru/chips/blob/master/src/Lib.hs#L57
execPath <- (byteString <$> getExecutablePath) >>= \ p ->
if "/ghc" `B.isSuffixOf` p
then (<> "/.local/bin/chips") . byteString <$> getHomeDirectory
else return p
Then why don't we add the alias for chips at the config.fish? It will provide better default and better UX to the users.
# chips (don't touch the lines below!)
alias chips "~/.local/bin/chips; and exec fish"
if [ -e ~/.config/chips/build.fish ]; source ~/.config/chips/build.fish; end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.