Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neil add dep erases deps.edn #131

Closed
akond opened this issue Oct 19, 2022 · 12 comments
Closed

neil add dep erases deps.edn #131

akond opened this issue Oct 19, 2022 · 12 comments

Comments

@akond
Copy link

akond commented Oct 19, 2022

If I execute neil add dep com.rpl.specter then my deps.edn becomes empty.

@borkdude
Copy link
Contributor

That's not good! We should probably check for a fully qualified name.

@borkdude
Copy link
Contributor

I can't repro the "deps.edn becomes empty" part:

borkdude@m1 /tmp/dude $ neil dep add com.rpl/specter
borkdude@m1 /tmp/dude $ cat deps.edn
{:deps {com.rpl/specter {:mvn/version "1.1.4"}}
 :aliases {}}
borkdude@m1 /tmp/dude $ neil dep add com.rpl.specter
borkdude@m1 /tmp/dude $ cat deps.edn
{:deps {com.rpl/specter {:mvn/version "1.1.4"}
        com.rpl.specter {:mvn/version nil}}
 :aliases {}}

Can you provide a sequence like the above?

We should probably never add a dep when the version is nil.

@akond
Copy link
Author

akond commented Oct 19, 2022

Here is my justfile:

akond@akond:~/workspace-test/xxxx$ cat justfile 
DIR:="issue-131"
run:
  rm -rf {{DIR}}
  neil new --name {{DIR}}
  hd {{DIR}}/deps.edn
  cd {{DIR}}; neil add dep com.rpl.specter
  hd {{DIR}}/deps.edn

So the result looks :

akond@akond:~/workspace-test/xxxx$ just
rm -rf issue-131
neil new --name issue-131
Creating project from org.corfield.new/scratch in issue-131
hd issue-131/deps.edn
00000000  7b 3a 70 61 74 68 73 20  5b 22 73 72 63 22 5d 0a  |{:paths ["src"].|
00000010  20 3a 64 65 70 73 20 20  7b 7d 0a 20 3a 61 6c 69  | :deps  {}. :ali|
00000020  61 73 65 73 20 0a 20 7b  3a 6e 65 69 6c 20 7b 3a  |ases . {:neil {:|
00000030  70 72 6f 6a 65 63 74 20  7b 3a 6e 61 6d 65 20 69  |project {:name i|
00000040  73 73 75 65 2d 31 33 31  2f 69 73 73 75 65 2d 31  |ssue-131/issue-1|
00000050  33 31 7d 7d 7d 7d 0a                              |31}}}}.|
00000057
cd issue-131; neil add dep com.rpl.specter
hd issue-131/deps.edn
00000000  0a                                                |.|
00000001

Please, notice, that I use com.rpl.specter and not com.rpl/specter

@borkdude
Copy link
Contributor

Yes, you should use the fully qualified symbol, but we should have some error checking for this.

@borkdude
Copy link
Contributor

Also please specify the version of neil you are using.

@akond
Copy link
Author

akond commented Oct 19, 2022

akond@akond:~/workspace-test/xxxx$ neil --version
neil 0.1.46

@akond
Copy link
Author

akond commented Oct 19, 2022

Yes, the repo name is bogus, but I don't think that emptying deps.edn is an adequate response.
And thank you for responding on such a short notice.

@borkdude
Copy link
Contributor

but I don't think that emptying deps.edn is an adequate response

Fully agreed :) This should be fixed.

@borkdude
Copy link
Contributor

Should be fixed with neil from master now. @akond Can you test this?

@akond
Copy link
Author

akond commented Oct 19, 2022

Yes, now it keeps the file untouched.
But I get no warnings either.

@borkdude
Copy link
Contributor

Very well, I'll release a new version

@borkdude
Copy link
Contributor

I assume this is fixed. Please leave a message if it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants