File tree 1 file changed +12
-1
lines changed
scripts/lib/bashy-node/node-project
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,16 @@ function do-fix {
90
90
local filePath=" $1 "
91
91
local fileDir=" ${filePath%/* } "
92
92
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
+
93
103
local oldDeps
94
104
oldDeps=" $( jval < " ${filePath} " --input=read ' .dependencies // {}' ) " \
95
105
|| return " $? "
@@ -124,11 +134,12 @@ function do-fix {
124
134
hasExportTesting:json=" ${hasExportTesting} " \
125
135
hasPrivateDir:json=" ${hasPrivateDir} " \
126
136
hasTestsDir:json=" ${hasTestsDir} " \
137
+ packageName=" ${packageName} " \
127
138
deps:json=" ${finalDeps} " '
128
139
(.scripts // {}) as $scripts
129
140
|
130
141
{
131
- name: .name ,
142
+ name: $packageName ,
132
143
version: .version,
133
144
type: "module",
134
145
private: true,
You can’t perform that action at this time.
0 commit comments