Code Monkey home page Code Monkey logo

chips's People

Contributors

heejongahn avatar kinoru avatar simnalamburt avatar xtendo-org avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chips's Issues

Release the next version of chips

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:

  1. i686-windows-gnu
  2. x86_64-unknown-linux-gnu
  3. aarch64-unknown-linux-musl
  4. x86_64-apple-darwin, OS X 10.12

You should specify distribution version if you're uploading darwin binary.

Chips cannot auto-upgrade inself

How to reproduce this error

image

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

Related issue

bug: Chips deletes all the plugins when executed offline

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?

chips shell autocompletion

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.

Running chips should reload the configuration

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:

  • The executable file needs to call the exec* family of functions to replace itself with fish.
  • Fish needs to execute chips by 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"

Running chips without making 'functions' directory throws an exception

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

Do not self-update if release version is lower

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.

Let's support more platforms

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"

TODOs

Doesn't work on Sierra

I get the following error when trying to run chips on the macOS Sierra public beta:

fish: 'chips' terminated by signal SIGKILL (Forced quit)

chips self-update fail: failed parsing the GitHub releases page. Perhaps you need to manually upgrade.

Related:

chips/src/SelfUpdate.hs

Lines 53 to 58 in 5484641

locationHeader =
"\nLocation: https://github.com/" <> repo <> "/releases/tag/"
getLatest = readProcess "curl"
[ "-D", "-", "-o", "/dev/null"
, "https://github.com/" <> repo <> "/releases/latest"
]

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

Config with nix?

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.

Doesn't work on WSL

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

Check the availability of git and curl

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.

Enable CI for automatic binary building

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!

  • Travis CI for Linux and OS X binaries
  • AppVeyor for Windows binary
  • GitHub Actions for Linux, macOS, Windows

Running chips without making `config.fish` throws an exception

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)

Proposal

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?

[RFC] Inject alias for chips at config.fish

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.