Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Mercurial on a Flash Drive?

So I do a lot of work on a school computer. We can't install anything but we have most of our tools on our flash drives but I was wondering if there's a way to get Command Prompt to use Mercurial off of my Flash Drive. Let's say in theory that Mercurial's files were on my flash drive, where would I go from there?

like image 280
NessDan Avatar asked Dec 15 '09 00:12

NessDan


Video Answer


2 Answers

To make Bryan's solution "truly" portable in Windows 2000/XP/Vista/7, assuming the BAT file is inside Mercurial's directory, use:

set PATH=%PATH%;%~dp0% 

So, no more hardcoded paths.

like image 199
user245794 Avatar answered Sep 22 '22 07:09

user245794


Say your flash drive was drive G: and your Mercurial executables are in G:\mercurial

Open a command prompt and enter:

set PATH=%PATH%;G:\mercurial

Proceed to use hg as normal

This should work, in theory. If you're on a *nix computer, you would do something like this (given /media/FLASHDRIVE is the path to your flash drive):

export PATH=$PATH:/media/FLASHDRIVE/mercurial

Hope that helps!

EDIT

In response to the comment below:

@ECHO OFF
REM Mercurial enabler :)
set PATH=%PATH%;G:\mercurial
cmd.exe

Should do it :)

like image 39
rossipedia Avatar answered Sep 24 '22 07:09

rossipedia