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

add-assembly translates absolute path to (wrong) relative path #2685

Closed
heavywatal opened this issue Jan 28, 2022 · 3 comments · Fixed by #2686
Closed

add-assembly translates absolute path to (wrong) relative path #2685

heavywatal opened this issue Jan 28, 2022 · 3 comments · Fixed by #2686
Labels
bug Something isn't working

Comments

@heavywatal
Copy link
Contributor

jbrowse add-assembly modifies a given absolute path to a relative path, which is wrong if --target= is used.

mkdir target
echo "{}" > target/config.json
touch /tmp/my.fa.gz
npx jbrowse add-assembly -f --target=target --type=indexedFasta --load=symlink /tmp/my.fa.gz
ls -1 target/
# config.json
# my.fa.gz@ ⇒ ../../../../tmp/my.fa.gz
# my.fa.gz.fai@ ⇒ ../../../../tmp/my.fa.gz.fai

Symlinks are calculated for $PWD of command execution, not for the files in target/.

Expected behavior

  1. Absolute paths should be kept as they are passed. jbrowse add-track works as expected because it keeps given absolute paths unchanged.
  2. If relative paths are mandatory for some reasons, it should at least calculate relative paths correctly.

Screenshots

The command lines above should explain.

Version:

@jbrowse/cli/1.5.9 darwin-x64 node-v16.13.2

Additional context

Thank you for your great software and hard work.

@cmdcolin
Copy link
Collaborator

thanks for pointing this out, we do indeed convert some things to relative paths and so this is likely a bug for symlink handling.

possible fix here #2686

@heavywatal
Copy link
Contributor Author

Thank you for the quick response! And sorry I forgot to report that it matters when --load=inPlace as well.

@cmdcolin
Copy link
Collaborator

cmdcolin commented Jan 29, 2022

good catch, thanks. I believe inPlace should be fixed now too, released as @jbrowse/cli 1.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants