trigger service: trimsubdir helper method
This commit is contained in:
parent
c8b931609e
commit
6465e7492a
2 changed files with 7 additions and 2 deletions
|
@ -95,6 +95,11 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
return type['get_redirect_url'](namespace, repository);
|
||||
};
|
||||
|
||||
// Helper to remove the prefix and suffix /s on subdir paths.
|
||||
triggerService.trimSubdir = function(subdir) {
|
||||
return subdir.replace(new RegExp('(^\/+|\/+$)'), '');
|
||||
};
|
||||
|
||||
triggerService.getTitle = function(name) {
|
||||
var type = triggerTypes[name];
|
||||
if (!type) {
|
||||
|
|
Reference in a new issue