-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set the destination filename #1
Comments
Sadly, I would opt for a // string
lnk('assets/favicon.ico', 'dist', {rename: 'subpath/newfavicon.ico'});
// => 'dist/subpath/newfavicon.ico'
// function
lnk(globby('assets/fav*.ico'), 'dist', {
rename: ({dirname, basename}) => `${dirname}/new-${basename}`
// or
rename: ({path}) => …
}); Implementing the |
Actually, for now the existing API worked for me: For now I will use both this package and link-dir. It has symlink overwriting, which we also need in pnpm.
Unless there's a breaking change and the function always expects the full path, right? That would also mean that the first argument can't be an array of targets anymore. I like the first solution with the string. Could it be a 3rd parameter maybe? lnk('assets/favicon.ico', 'dist', 'subpath/newfavicon.ico');
// => 'dist/subpath/newfavicon.ico' |
IMO, that would be too cumbersome; and moreover, it could be confused with the
It is not clear to me, how From the source you've linked: return linkDir(absolutePath, dest) At a first glance this could also be done with return lnk(absolutePath, dest, {type: 'junction'}) |
ok, seems like
Thanks, I'll check the force option today, maybe that will do |
Landed with @zkochan I hope these work for you: lnk('assets/favicon.ico', 'dist', {rename: 'newfavicon.ico'});
// or e.g. with globs
lnk(globby('assets/fav*.ico'), 'dist', {
rename: ({base}) => `new${base}`
}); |
Thank you! |
I'd like to use this package in pnpm, but I need the possibility to set the symlink filename. Currently it takes the source filename and that is not good for all of my use cases.
So instead of this:
I'd need something like
I don't know what would be the best way to add this feature. Maybe changing the default behavior? That would be closer to the
fs.symlink
APIThe text was updated successfully, but these errors were encountered: