Skip to content
Snippets Groups Projects
Commit 98c80792 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] duniter/duniter#1065 Allow NPM modules

parent 1468a069
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ module.exports = ($scope, $http, $state, $interval, $timeout, UIUtils, summary,
$scope.installModule = () => {
const pkg = $scope.module_to_install
if (!(pkg.match(/^file:\/\//) || pkg.match(/^https?:\/\/.+\.(tar\.gz|tgz)$/) || pkg.match(/^git(\+ssh|\+http|\+https)?:\/\/.+\.git$/))) {
if (!(pkg.match(/^.+@(~||\^)?\d+\.\d+\.\d+$/) || pkg.match(/^file:\/\//) || pkg.match(/^https?:\/\/.+\.(tar\.gz|tgz)$/) || pkg.match(/^git(\+ssh|\+http|\+https)?:\/\/.+\.git$/))) {
UIUtils.toast('settings.modules.wrong_package_source')
return
}
......
......@@ -1777,7 +1777,7 @@ module.exports = function ($scope, $http, $state, $interval, $timeout, UIUtils,
$scope.installModule = function () {
var pkg = $scope.module_to_install;
if (!(pkg.match(/^file:\/\//) || pkg.match(/^https?:\/\/.+\.(tar\.gz|tgz)$/) || pkg.match(/^git(\+ssh|\+http|\+https)?:\/\/.+\.git$/))) {
if (!(pkg.match(/^.+@(~||\^)?\d+\.\d+\.\d+$/) || pkg.match(/^file:\/\//) || pkg.match(/^https?:\/\/.+\.(tar\.gz|tgz)$/) || pkg.match(/^git(\+ssh|\+http|\+https)?:\/\/.+\.git$/))) {
UIUtils.toast('settings.modules.wrong_package_source');
return;
}
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment