diff --git a/clouds/bigquery/common/build_modules.js b/clouds/bigquery/common/build_modules.js index 41f6c3bc7..a112d9acb 100755 --- a/clouds/bigquery/common/build_modules.js +++ b/clouds/bigquery/common/build_modules.js @@ -159,7 +159,7 @@ if (argv.production) { let content = output.map(f => f.content).join(separator); function apply_replacements (text) { - const libraries = [... new Set(text.match(new RegExp('@@BQ_LIBRARY_.*_BUCKET@@', 'g')))]; + const libraries = [... new Set(content.match(new RegExp('@@BQ_LIBRARY_[^@]*?_BUCKET@@', 'g')))]; for (let library of libraries) { let libraryName = library.replace('@@BQ_LIBRARY_', '').replace('_BUCKET@@', '').toLowerCase(); if (makelib == libraryName) { diff --git a/clouds/bigquery/common/list_libraries.js b/clouds/bigquery/common/list_libraries.js index 878c35e17..fc2ecea29 100755 --- a/clouds/bigquery/common/list_libraries.js +++ b/clouds/bigquery/common/list_libraries.js @@ -134,7 +134,7 @@ function add (f, include) { functions.forEach(f => add(f)); const content = output.map(f => f.content).join('\n'); -let libraries = [... new Set(content.match(new RegExp('@@BQ_LIBRARY_.*_BUCKET@@', 'g')))] +let libraries = [... new Set(content.match(new RegExp('@@BQ_LIBRARY_[^@]*?_BUCKET@@', 'g')))] .map(l => l.replace('@@BQ_LIBRARY_', '').replace('_BUCKET@@', '').toLowerCase()); // Exclude libraries pointed by makelib as they are deployed separately