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

version reporting in compiled/installed version from url is just "master" or "alpha" #18

Open
yarikoptic opened this issue Jun 11, 2024 · 2 comments

Comments

@yarikoptic
Copy link
Contributor

I don't know if there is any reasonable solution here, may be somehow possible to install from git exported archive which could do some subs for strings and provide some idea of a version?

❯ deno compile -o /tmp/bids-validator-deno -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts
...
❯ /tmp/bids-validator-deno --version
bids-validator master

even from a tag it is kinda not so good

❯ deno compile -o /tmp/bids-validator-deno -A https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.7-dev.0/bids-validator/src/bids-validator.ts
Check https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.7-dev.0/bids-validator/src/bids-validator.ts
Compile https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.7-dev.0/bids-validator/src/bids-validator.ts to /tmp/bids-validator-deno
Archive:  /home/yoh/.tmp/.tmpAIaseK/denort.zip
  inflating: denort                  
❯ /tmp/bids-validator-deno --version
bids-validator alpha
❯ deno compile -o /tmp/bids-validator-deno -A https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.6/bids-validator/src/bids-validator.ts
Check https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.6/bids-validator/src/bids-validator.ts
Compile https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.6/bids-validator/src/bids-validator.ts to /tmp/bids-validator-deno
Archive:  /home/yoh/.tmp/.tmphvjo7J/denort.zip
  inflating: denort                  
❯ /tmp/bids-validator-deno --version
bids-validator alpha

It looks good if I compile from a local clone:

❯ deno compile -o /tmp/bids-validator-deno -A bids-validator/bids-validator/src/bids-validator.ts
Check file:///tmp/bids-validator/bids-validator/src/bids-validator.ts
Compile file:///tmp/bids-validator/bids-validator/src/bids-validator.ts to /tmp/bids-validator-deno
Archive:  /home/yoh/.tmp/.tmp928ec7/denort.zip
  inflating: denort                  
deno compile -o /tmp/bids-validator-deno -A   7.97s user 0.49s system 220% cpu 3.842 total
❯ /tmp/bids-validator-deno --version
bids-validator v1.14.7-dev.0-62-gbd302130
@effigies
Copy link
Contributor

We haven't yet released since adding in version information, so the version on deno.land still says alpha. deno.land only hosts tags, it's not just a copy of the repository.

There's not much to do if you build directly from a git branch. It will tell you the $REF that you entered because all it has to go on is a URL.

@effigies
Copy link
Contributor

effigies commented Aug 7, 2024

deno run --reload -A https://deno.land/x/[email protected]/bids-validator.ts --version
bids-validator v1.14.8deno run --reload -A https://raw.githubusercontent.com/bids-standard/bids-validator/v1.14.8/bids-validator/src/bids-validator.ts --version
bids-validator v1.14.8deno run --reload -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts --version
bids-validator master

That said:

deno run --reload -A https://deno.land/x/bids_validator/bids-validator.ts --version
Warning Implicitly using latest version (v1.14.9-dev.0) for https://deno.land/x/bids_validator/bids-validator.ts
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split')
    return url.pathname.split('@')[1].split('/')[0]
                                     ^
    at getRemoteVersion (https://deno.land/x/[email protected]/version.ts:50:38)
    at getVersion (https://deno.land/x/[email protected]/version.ts:30:15)
    at parseOptions (https://deno.land/x/[email protected]/setup/options.ts:51:25)
    at main (https://deno.land/x/[email protected]/main.ts:11:25)
    at https://deno.land/x/[email protected]/bids-validator.ts:3:22

@effigies effigies transferred this issue from bids-standard/legacy-validator Nov 4, 2024
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