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

Fix ability to use add-track force on symlink tracks #1966

Merged
merged 2 commits into from
May 14, 2021

Conversation

cmdcolin
Copy link
Collaborator

Possible fix for #1958

The main thing is that it needs to unlink the destination before trying to symlink it

It is somewhat of a coincidence that copy behavior is to overwrite by default. I changed it to actually use COPYFILE_EXCL to avoid accidentally overwriting a destination file, and the user can go back and use --force to overwrite it, which matches the behavior of overwriting the symlink added in this PR

It uses a try catch because if the destination symlink doesn't exist it would otherwise throw

Adds some misc refactoring (could be split out) to try to simplify or deduplicate some repetitive logic in the code and tests with the hope that simpler code==easier to see code paths

https://github.com/GMOD/jbrowse-components/compare/fix_symlink_add_track?expand=1#diff-7c20288c5391381db2117575ccf46defd61fd768480ee3af4cc60d2fe1bbde21R315-R318

@cmdcolin cmdcolin changed the title Fix ability to use add-track force Fix ability to use add-track force on symlink tracks May 12, 2021
@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #1966 (852b980) into main (9b37051) will increase coverage by 0.88%.
The diff coverage is 60.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1966      +/-   ##
==========================================
+ Coverage   59.27%   60.15%   +0.88%     
==========================================
  Files         459      467       +8     
  Lines       21736    21895     +159     
  Branches     5081     5103      +22     
==========================================
+ Hits        12885    13172     +287     
+ Misses       8550     8421     -129     
- Partials      301      302       +1     
Impacted Files Coverage Δ
packages/core/ui/FileSelector.tsx 68.62% <ø> (-0.61%) ⬇️
packages/core/ui/RecentSessionCard.js 14.28% <ø> (ø)
...s/breakpoint-split-view/src/BreakpointSplitView.ts 7.69% <ø> (-1.75%) ⬇️
products/jbrowse-desktop/src/Loader.tsx 0.00% <0.00%> (ø)
products/jbrowse-desktop/src/jbrowseModel.js 15.49% <0.00%> (-2.25%) ⬇️
products/jbrowse-desktop/src/rootModel.ts 36.11% <0.00%> (-1.39%) ⬇️
products/jbrowse-web/src/AdminComponent.tsx 0.00% <0.00%> (ø)
products/jbrowse-web/src/Loader.tsx 55.63% <0.00%> (-3.44%) ⬇️
...point-split-view/src/components/Translocations.tsx 3.50% <3.50%> (-9.00%) ⬇️
products/jbrowse-desktop/src/JBrowse.js 55.17% <16.66%> (-3.01%) ⬇️
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a2059b...852b980. Read the comment docs.

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label May 12, 2021
@cmdcolin cmdcolin force-pushed the fix_symlink_add_track branch from 0f2ae2e to 0ef27b7 Compare May 12, 2021 15:44
@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels May 12, 2021
@cmdcolin cmdcolin merged commit d52c900 into main May 14, 2021
@cmdcolin cmdcolin deleted the fix_symlink_add_track branch May 14, 2021 02:26
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 this pull request may close these issues.

1 participant