jtrussell / svn-npm-crutch

Allow node modules to be installed from svn repos
MIT License
14 stars 10 forks source link

svn repo being pulled twice #7

Open hmoffatt opened 8 years ago

hmoffatt commented 8 years ago

I've added svn-npm-crutch to my dependencies, and added an svnDependencies section to package.json. The svn-npm-crutch hook has been added to the install script automatically.

Now if I run "npm install" again to refresh things, the SVN repo is fetched twice.

In the output I see:

$ npm install

> svn-npm-crutch@0.5.4 install /home/hamish/.../node_modules/svn-npm-crutch
> node scripts/install.js

svn-crutch Installing foo from svn...
[...]
Checked out revision 14433.
svn-crutch Cleaning up svn repo foo...
Updating '.':
At revision 14433.
svn-crutch Making sure foo is up to date...
Updating '.':
At revision 14433.
svn-crutch Cleaning up svn repo foo...
Updating '.':
At revision 14433.
svn-crutch Running `npm install` on foo...
svn-crutch Successfully installed 
svn-crutch 
svn-crutch ============================================
svn-crutch     Finished installing svn dependencies
svn-crutch ============================================

> rising-software@1.0.0 install /home/hamish/dev/...
> node ./node_modules/svn-npm-crutch/lib/svn-npm-crutch.js

svn-crutch Installing foo from svn...

and then it all gets done again.

Further, is it possible to update the checkout rather than fetching it from scratch? My module is big and the server is remote, so I'd rather not fetch it every time if it hasn't changed.

jtrussell commented 8 years ago

Hmm, I'm not certain why you're seeing double installs. I'd certainly be open to a PR that corrects this issue and perhaps one that performs an update instead of a full checkout each time if the dep already exists. A quick look back at the source though reveals this little gem: https://github.com/jtrussell/svn-npm-crutch/blob/master/lib/svn-npm-crutch.js#L50-L61 which maybe suggests why svn updates might be difficult.