Skip to content

Commit

Permalink
Fix for basename calculation - this actually works with URLs now.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Mar 1, 2018
1 parent 8be4642 commit ca4f6d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/galaxy/scripts/components/RuleCollectionBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,10 @@ const Rules = {
rule.target_column = component.addColumnBasenameTarget;
},
apply: (rule, data, sources) => {
// https://github.com/kgryte/regex-basename-posix/blob/master/lib/index.js
const re = /^(?:\/?|)(?:[\s\S]*?)((?:\.{1,2}|[^\/]+?|)(?:\.[^.\/]*|))(?:[\/]*)$/;
// https://github.com/kgryte/regex-basename-posix/blob/master/lib/index.js
//const re = /^(?:\/?|)(?:[\s\S]*?)((?:\.{1,2}|[^\/]+?|)(?:\.[^.\/]*|))(?:[\/]*)$/;
// https://stackoverflow.com/questions/8376525/get-value-of-a-string-after-a-slash-in-javascript
const re = /[^/]*$/;
const target = rule.target_column;
return applyRegex(re, target, data);
}
Expand Down

0 comments on commit ca4f6d2

Please sign in to comment.