spinny icon indicating copy to clipboard operation
spinny copied to clipboard

Do not require ./spinners.json

Open moigagoo opened this issue 9 years ago • 4 comments

AFAIU currently, in order to use spinners, spinners.json must sit in the same directory as the code invoking the spinners. This means that any project using spinners has to ship spinners.json.

The proposal is to use the default spinners.json file that is shipped with the package with the option to provide a custom one.

moigagoo avatar Aug 24 '17 06:08 moigagoo

A pull request would be appreciated if possible, I am a bit overwhelmed with work as of lately. Feel free to do some magic. :)

molnarmark avatar Aug 24 '17 22:08 molnarmark

Can reproduce:

spin.nim(3)              spin
spinny.nim(26)           newSpinny
sysio.nim(399)           readFile
system.nim(2839)         sysFatal
Error: unhandled exception: cannot open: spinners.json [IOError]

:crying_cat_face:

juancarlospaco avatar Jul 12 '18 00:07 juancarlospaco

Hi there and thanks for starting this project!

Using Nimble to install spinny for a binary project, I still encountered the following error when running nimble build:

.../.nimble/pkgs/spinny-0.1.2/spinny.nim(26, 33) Error: cannot open file: spinners.json

It looked like the json wasn't being pulled per the nimblemeta.json files attribute:

{"url":"https://github.com/molnarmark/spinny","vcsRevision":"258a82a14b16cbd4c4a43b4f4b77709ac42cfab8","files":["/spinny.nimble","/spinny.nim"],"binaries":[],"isLink":false}

I wonder if specifying the JSON file in the Nimble package would help to make package installation a little more seamless? E.g.,

installFiles = @["spinny.nim", "spinny.nimble", "resources/spinners.json"]

I was able to eventually get it to work on my machine and can provide a branch. I'm new to Nim, though, and am not sure how to test that the installFiles option works correctly.

MilesDowe avatar Oct 17 '18 23:10 MilesDowe

  1. Fork it.
  2. Fix it.
  3. uninstall it (if installed).
  4. install it from your fork nimble install https://github.com/youruser/spinny
  5. Test all the stuff with it.

juancarlospaco avatar Oct 18 '18 00:10 juancarlospaco