File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,26 @@ export const addPackages = async (
174
174
replacedVersion =
175
175
replacedVersion == localAddress ? '' : replacedVersion
176
176
}
177
+
178
+ if ( pkg . bin ) {
179
+ const binDir = join ( workingDir , 'node_modules' , '.bin' )
180
+ if ( typeof pkg . bin === 'string' ) {
181
+ fs . ensureDirSync ( binDir )
182
+ ensureSymlinkSync (
183
+ join ( destYalcCopyDir , pkg . bin ) ,
184
+ join ( binDir , pkg . name )
185
+ )
186
+ } else if ( typeof pkg . bin === 'object' ) {
187
+ fs . ensureDirSync ( binDir )
188
+ for ( const name in pkg . bin ) {
189
+ ensureSymlinkSync (
190
+ join ( destYalcCopyDir , name ) ,
191
+ join ( binDir , pkg . bin [ name ] )
192
+ )
193
+ }
194
+ }
195
+ }
196
+
177
197
const addedAction = options . link ? 'linked' : 'added'
178
198
console . log (
179
199
`Package ${ pkg . name } @${
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export interface PackageManifest {
73
73
name : string
74
74
version : string
75
75
private ?: boolean
76
- files : string [ ]
76
+ bin ? : string | { [ name : string ] : string }
77
77
dependencies ?: { [ name : string ] : string }
78
78
devDependencies ?: { [ name : string ] : string }
79
79
workspaces ?: string [ ]
Original file line number Diff line number Diff line change 1
1
import * as fs from 'fs-extra'
2
2
import * as path from 'path'
3
- import { getStoreMainDir , values , readPackageManifest } from '.'
3
+ import { getStoreMainDir , values } from '.'
4
4
import { readLockfile } from './lockfile'
5
5
6
6
export type PackageName = string & { __packageName : true }
You can’t perform that action at this time.
0 commit comments