Skip to content

Doesn't support ~ in path  #308

@masukomi

Description

@masukomi

setup:
Created a new shard. Wanted to test it locally before pushing

used this in my dependencies:

  bayes_classifier:
    path: ~/workspace/bayes_classifier

shards kept complaining about

Missing "shard.yml" for "bayes_classifier"

but I was confident it was there (and readable). I tweaked path.cr to indicate where shards was looking when it failed:

$ ~/workspace/shards/shards install
Resolving dependencies
Missing "shard.yml" for "bayes_classifier"
  Expected it at ~/workspace/bayes_classifier/shard.yml
$ ls ~/workspace/bayes_classifier/shard.yml
/Users/masukomi/workspace/bayes_classifier/shard.yml

Modifying the value of the path: to be /Users/masukomi/workspace/bayes_classifier solved the problem.

using ~ to represent the current user's home directory is an incredibly common and decades old practice. This should be supported or at the very least the error message should indicate that ~ isn't supported in paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions