- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
Symlink to file:// repos by adding ?symlink suffix #58
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
base: master
Are you sure you want to change the base?
Conversation
4bf6753    to
    3c16aea      
    Compare
  
            
          
                src/filesystem.cpp
              
                Outdated
          
        
      | const auto &nativeLink = nativePath(link); | ||
|  | ||
| #ifdef _WIN32 | ||
| return CreateSymbolicLink(nativeLink.c_str(), target.c_str(), 0x0); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do here... I've tried a bunch of different variations. I don't have a windows machine, so it takes ~15 minutes for CI to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows API needs UTF-16 wchar_t strings instead of UTF-8 char strings:
return CreateSymbolicLink(nativeLink.c_str(), Win32::widen(target).c_str(), 0);(CreateSymbolicLink is an alias for CreateSymbolicLinkW. CreateSymbolicLinkA takes const char*, but its character set is limited to whatever the current system ANSI codepage is.)
Also I'm pretty sure Windows requires the process to gain admin privileges to be allowed to create symlinks... (And the SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag requires Developer Mode to be enabled.) If so I don't think this will be acceptable as a feature, or it will need to only be available on Linux/macOS...
Anyway, I'll check & review the PR more closely later on. Thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I changed it to use Path and now the Windows build went green.
I hope you will consider including it, even if we have to disable support for it on Windows. It's super handy.
6bc81ee    to
    79e9c5b      
    Compare
  
    71bfec5    to
    bba28f6      
    Compare
  
    2dd218f    to
    d374b06      
    Compare
  
    
(note: I haven't written C++ in ~20 years! all suggestions welcome)
I posted in the forum dev thread asking about workflow for developing reapacks. I found it a bit clunky to develop by adding scripts directly via actions, and then to elsewhere add a package.
It would be nice to install a package locally so it symlinks to files. Then as you edit the scripts, Reaper will pick up the updates automatically, just like if you added the scripts directly without ReaPack.
To use it, append
?symlinkto afile://repo URL, e.g.file:///path/to/my/index.xml?symlink. Install (or reinstall) a package, and it will symlink the files instead of copying them. Reaper picks up any changes you make to the script.Tested on MacOS 10.15.6, REAPER 6.68