Fork me on GitHub
#admin-announcements
<
2015-09-08
>
xavi21:09:11

I just published a library to Clojars

xavi21:09:54

Does anybody know how to make the project's GitHub link appear to the right of the small GitHub icon?

xavi21:09:17

(currently "N/A" is shown)

bostonaholic21:09:27

@xavi: if you're using leiningen, you can set a :url in the project.clj

bostonaholic21:09:40

I think that's where it's pulling

bostonaholic21:09:26

I have no idea 😜

bostonaholic21:09:48

projects I've published have it so I'm not sure

xavi21:09:06

was looking at the same simple_smile

bostonaholic22:09:28

<scm>
    <tag>69c27dd15a0c6b4046019c8b4ccf45e75fb9b8cd
</tag>
    <url/>
  </scm>

bostonaholic22:09:34

empty url is why

xavi22:09:58

where is that XML snippet from?

bostonaholic22:09:39

that is in ~/.m2/repository/mongologic/mongologic/0.5.0/mongologic-0.5.0.pom

bostonaholic22:09:57

should look something like this

<scm>
    <connection>scm:git:
    <developerConnection>scm:git:
    <tag>d39ab3e03e490a376c3089d9a0a23ab9af73f85b
</tag>
    <url>https://github.com/Hendrick/ring-okta</url>
  </scm>

bostonaholic22:09:20

how are you deploying to clojars?

xavi22:09:01

I used lein deploy clojars

xavi22:09:22

Maybe I can fix adding :scm in project.clj

bostonaholic22:09:11

that might work

xavi22:09:51

and maybe it didn't find out the info automatically because I don't have an origin git remote (I have github and bitbucket remotes)... just guessing

bostonaholic22:09:16

if you do a lein install does it add the url in the pom I pointed to earlier?

bostonaholic22:09:36

found the problem

xavi22:09:38

no, if I don't have an git origin remote, but...

bostonaholic22:09:08

user=> (def url "")
#'user/url
user=> (re-matches #"(?:[A-Za-z_]{2,}@)?" url)
nil
user=> (re-matches #"[^:]+://(?:[A-Za-z_]{2,}@)?" url)
nil

bostonaholic22:09:32

those are the two regexes being used by leiningen to try and parse your username/project

xavi22:09:32

after renaming one of my remotes to be origin (`git remote rename github origin`) then url is generated

bostonaholic22:09:36

both return nil

bostonaholic22:09:41

you could have both a github and an origin

bostonaholic22:09:12

make them the same

bostonaholic22:09:20

I'm not sure if you can "alias" a git remote

xavi22:09:24

Just wanted to avoid having an origin, to be explicit on where I was pushing... but not a big deal (and now that project is public I'll probably don't push to BitBucket anymore)

xavi22:09:38

It worked for a new SNAPSHOT release I pushed...

xavi22:09:08

Thanks a lot for your help @bostonaholic !

bostonaholic22:09:56

heck of a rabbit hole