Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

Windows relative symlinks falling back to junction don't work. #33

Closed
BSick7 opened this issue Aug 11, 2015 · 7 comments
Closed

Windows relative symlinks falling back to junction don't work. #33

BSick7 opened this issue Aug 11, 2015 · 7 comments

Comments

@BSick7
Copy link

BSick7 commented Aug 11, 2015

If a windows symlink fails (usually because of non-admin terminal), gulp-symlink falls back to using junctions. However, if trying to create a relative symlink, this will fail for junctions as well (http://ss64.com/nt/mklink.html).

A nicer error message would help diagnose this issue. Perhaps, if there is a permission issue and relative, report just that: "Relative symlinks require admin privileges."

@ben-eb
Copy link
Owner

ben-eb commented Aug 24, 2015

I can't test on Windows (beyond running CI) so I would appreciate any help on this.

@jdaudier
Copy link

jdaudier commented Oct 1, 2015

I think I might be running into this issue.

@BSick7 Does this mean if I do this .pipe(symlink('../../.git/hooks/pre-commit', {force: true}));, it will break for Windows?

@BSick7
Copy link
Author

BSick7 commented Oct 1, 2015

@jdaudier I can't confirm this, but it appears that symlink creates a relative symlink by default. This would break on windows if the command is not run in an admin context.

@jdaudier
Copy link

jdaudier commented Oct 1, 2015

@BSick7 Can you explain what you mean by if the command is not run in an admin context? Noob question, sorry.

@BSick7
Copy link
Author

BSick7 commented Oct 1, 2015

@jdaudier By default, a new command prompt is not run under admin rights. Usually, a user has to right click on command prompt and click Run as Administrator.

@cherrydev
Copy link

Since

  • This is a gulp plugin and there's basically no justification for ever wanting to run gulp as an administrator
  • The 'type' argument for fs.symlink is ignored on platforms other than windows
  • Directory junctions are essentially equivalent to directory symlinks (except in exotic cases like crossing remote filesystems)

…I would recommend that this gulp plugin, in order to be cross-platform, should:

  • Only support directories, not files
  • Always specify 'junction' as the type (instead of 'file' or 'directory')

@ben-eb
Copy link
Owner

ben-eb commented Jan 30, 2016

This module has now been deprecated. https://github.com/ben-eb/gulp-symlink#deprecation-notice

@ben-eb ben-eb closed this as completed Jan 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants