From 23d75e6be0ea70a8882230ef05274c45fa7a5720 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 1 Jan 2021 17:33:04 +0100 Subject: [PATCH] yarn2nix: improve naming regexes Originally submitted in https://github.com/nix-community/yarn2nix/pull/128 --- .../tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js index bd48b84f22d..d3c7288a50a 100644 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js @@ -22,8 +22,8 @@ function urlToName(url) { } return url - .replace('https://registry.yarnpkg.com/', '') // prevents having long directory names - .replace(/[@/:-]/g, '_') // replace @ and : and - characters with underscore + .replace(/https:\/\/(.)*(.com)\//g, '') // prevents having long directory names + .replace(/[@/%:-]/g, '_') // replace @ and : and - and % characters with underscore } module.exports = urlToName