symlink is used when adding local plugin in windows
See original GitHub issueWhen we add local plugin as
cordova plugin add /path/to/local_plugin/
in windows environment, a symlink
is created.
I feel that a junction
should be created. Becuase npm
command creates a junction
in windows.
My question is that symlink in windows is ok?
I checked this by using cordova-cli
8.1.x in github with cordova-lib@9.0.0-nightly.2018.9.20.63b26e63
in npm.
> ..\cordova-cli\bin\cordova.cmd -v
8.0.1-dev (cordova-lib@9.0.0-nightly.2018.9.20.63b26e63)
> ..\cordova-cli\bin\cordova.cmd plugin add ..\..\plugins\cordova-plugin-camera
The result is following. (Here I add cordova-plugin-camera downloaded to my local PC)
> dir node_modules
2018/09/20 18:36 <DIR> .
2018/09/20 18:36 <DIR> ..
2018/09/20 18:36 <JUNCTION> cordova-plugin-camera [C:\Users\knaito\Documents\work\cordova\plugins\cordova-plugin-camera]
The node_module is junction
pointing to the original directory. (This is ok)
> dir plugins
2018/09/20 18:36 <DIR> .
2018/09/20 18:36 <DIR> ..
2018/09/20 18:36 <SYMLINK> cordova-plugin-camera [C:\Users\knaito\Documents\work\cordova\plugins\cordova-plugin-camera\]
2018/09/20 18:36 241 fetch.json
The plugin is symlink
pointing to the original directory. (Is this ok?)
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Symlinks in Windows 10! - Windows Developer Blog
A symlink is essentially a pointer to a file or folder located elsewhere, consumes little space and is very fast to create (compared...
Read more >Using Symlinks With Local by Flywheel For Plugin Development
When developing plugins with Local by Flywheel it's a good idea to keep the plugin code separate from your WordPress installs.
Read more >How to Use 'Symlinks' to Store Your Plugins and Themes Off ...
Symlinks enable you to use WordPress plugins and themes without storing them in your wp-content folder. You can take advantage of them in ......
Read more >Symlink a plugin in local development, works but got Debug ...
The proper way is to use the plugin_dir_path, something like require_once plugin_dir_path(__FILE__).'github-updater.php';.
Read more >Managing WordPress Development With Symlinks - Kinsta®
Symlinks can be used to point a plugin or theme from one central location to multiple WordPress installs. This minimizes development and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Anyway, the basic function like a
CreateFileW
does not work. I conclude that asymlink
pointing to a directory should not be used. We should use ajunction
, asymlinkd
or copied directory instead.I found one thing about this issue. I tried to debug following commands
by using VisualStudio 2017 where foo is a
symlink
pointing to other directory.Then I found the error becomes from
in
deps/uv/src/win/fs.c
. See https://github.com/nodejs/node/blob/9b292272ff3d71a0ebabe46d040346dbd34585db/deps/uv/src/win/fs.c#L1252CreateFileW
returnsINVALID_HANDLE_VALUE
for asymlink
pointing to other directory.Because
CreateFileW
is a Win32API function, I could not investigate it more detailed.