File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
scripts/lib/bashy-node/node-project Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,16 @@ function do-fix {
9090 local filePath=" $1 "
9191 local fileDir=" ${filePath%/* } "
9292
93+ local packageName=" ${fileDir} "
94+ if [[ ${packageName} =~ /@ (.* )$ ]]; then
95+ # The directory structure has the form `@<project>/<name>`.
96+ packageName=" ${BASH_REMATCH[2]} "
97+ else
98+ # No `@<project>`, so just use the final directory name, and assume it's
99+ # in `@this`.
100+ packageName=" @this/${packageName##*/ } "
101+ fi
102+
93103 local oldDeps
94104 oldDeps=" $( jval < " ${filePath} " --input=read ' .dependencies // {}' ) " \
95105 || return " $? "
@@ -124,11 +134,12 @@ function do-fix {
124134 hasExportTesting:json=" ${hasExportTesting} " \
125135 hasPrivateDir:json=" ${hasPrivateDir} " \
126136 hasTestsDir:json=" ${hasTestsDir} " \
137+ packageName=" ${packageName} " \
127138 deps:json=" ${finalDeps} " '
128139 (.scripts // {}) as $scripts
129140 |
130141 {
131- name: .name ,
142+ name: $packageName ,
132143 version: .version,
133144 type: "module",
134145 private: true,
You can’t perform that action at this time.
0 commit comments