Commits

Antonio Alvarado Hernández committed c856641

welcome `tnothome` project!

Comments (0)

Files changed (4)

+`tnothome` README
+=================
+
+What?
+-----
+
+This folder contains a copy of my `%HOME%\Local` tree.
+
+
+How?
+----
+
+You just need to creates your own *home directory*, e.g. using the *Vincent's `setenv` tool* [1]:
+
+    C:\> setenv -u HOME "<put-your-home-directory-path-here>"
+
+Now, to easy deploy it, you should execute following command at the *Command prompt*:
+
+    C:\> hg clone https://bitbucket.org/tnotstar/tnothome "%HOME%\Local"
+    destination directory: tnothome
+    requesting all changes
+    adding changesets
+    adding manifests
+    adding file changes
+    added 1 changesets with 4 changes to 4 files
+    updating to branch default
+    4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+It's useful to append `%HOME%\Local\bin` to the `PATH` environment variable.
+
+    C:\> setenv -u PATH "%PATH%;%HOME%\Local\bin"
+
+Warning
+-------
+
+Tested only on *Windows XP SP3*!
+
+[1]: http://barnyard.syr.edu/~vefatica/#SETENV
+@echo off
+rem ----------------------------------------------------------------------------
+rem Copyright (c) 2011, 2012 Antonio Alvarado Hernández - All rights reserved
+rem ----------------------------------------------------------------------------
+rem
+rem   Licensed under the Apache License, Version 2.0 (the "License");
+rem   you may not use this file except in compliance with the License.
+rem   You may obtain a copy of the License at
+rem
+rem       http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem   Unless required by applicable law or agreed to in writing, software
+rem   distributed under the License is distributed on an "AS IS" BASIS,
+rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem   See the License for the specific language governing permissions and
+rem   limitations under the License.
+rem
+rem ----------------------------------------------------------------------------
+rem $Id$
+rem ----------------------------------------------------------------------------
+
+
+setlocal enableextensions
+setlocal disabledelayedexpansion
+
+set NAME=%~n0 && shift
+
+if [%0] == [] goto syntax
+set SSH_TARGET=%0 && shift
+
+if [%0] == [] goto :syntax
+set SSH_COMMAND=%0 && shift
+
+set SSH_PROGRAM=plink
+set SSH_OPTIONS=-A -t -X -agent -ssh
+
+if exist "%SSH_COMMAND%" set SSH_ISFILE=-m
+
+:execute
+echo Info: Executing %SSH_COMMAND% on host %SSH_HOST%... 1>&2
+%SSH_PROGRAM% %SSH_OPTIONS% %SSH_TARGET% %SSH_ISFILE% %SSH_COMMAND% %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+echo.
+echo Info: Program exited with code %ERRORLEVEL% 1>&2
+goto :eof
+
+:syntax
+echo. 1>&2
+echo Fatal: invalid number of arguments 1>&2
+echo. 1>&2
+echo   Syntax: %NAME% ^<user@host^> ^<command^> [^<arg1^>...] 1>&2
+goto :eof
+
+endlocal
+
+:eof
+@echo off
+rem ----------------------------------------------------------------------------
+rem Copyright (c) 2011, 2012 Antonio Alvarado Hernández - All rights reserved
+rem ----------------------------------------------------------------------------
+rem
+rem   Licensed under the Apache License, Version 2.0 (the "License");
+rem   you may not use this file except in compliance with the License.
+rem   You may obtain a copy of the License at
+rem
+rem       http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem   Unless required by applicable law or agreed to in writing, software
+rem   distributed under the License is distributed on an "AS IS" BASIS,
+rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem   See the License for the specific language governing permissions and
+rem   limitations under the License.
+rem
+rem ----------------------------------------------------------------------------
+rem $Id$
+rem ----------------------------------------------------------------------------
+
+
+setlocal enableextensions
+setlocal disabledelayedexpansion
+
+set NAME=%~n0 && shift
+
+set SED_PROGRAM=sed
+
+if [%0] == [-u] set SED_OPTIONS=-e "s/\\/\//g"
+if [%0] == [-w] set SED_OPTIONS=-e "s/\//\\/g"
+
+if not defined SED_OPTIONS goto :syntax
+
+if [%1] == []  set READ_COMMAND=getclip
+if [%1] == [-] set READ_COMMAND=cat
+
+if not defined READ_COMMAND set READ_COMMAND=echo %1
+
+:execute
+%READ_COMMAND% | %SED_PROGRAM% %SED_OPTIONS%
+goto :eof
+
+:syntax
+echo. 1>&2
+echo Fatal: invalid command line arguments 1>&2
+echo. 1>&2
+echo   Syntax: %NAME% [-u^|-w] 1>&2
+echo           %NAME% [-u^|-w] - 1>&2
+echo           %NAME% [-u^|-w] ^<path-string^> 1>&2
+goto :eof
+
+endlocal
+
+:eof
+@echo off
+rem ----------------------------------------------------------------------------
+rem Copyright (c) 2011, 2012 Antonio Alvarado Hernández - All rights reserved
+rem ----------------------------------------------------------------------------
+rem
+rem   Licensed under the Apache License, Version 2.0 (the "License");
+rem   you may not use this file except in compliance with the License.
+rem   You may obtain a copy of the License at
+rem
+rem       http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem   Unless required by applicable law or agreed to in writing, software
+rem   distributed under the License is distributed on an "AS IS" BASIS,
+rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem   See the License for the specific language governing permissions and
+rem   limitations under the License.
+rem
+rem ----------------------------------------------------------------------------
+rem $Id$
+rem ----------------------------------------------------------------------------
+
+
+setlocal enableextensions
+
+set NAME=%~n0
+shift /0
+
+if [%0] == [] goto syntax
+set GIT_DWLDURL=%0
+shift /0
+
+set GIT_TMPFILE=%TEMP%\UG%RANDOM%.bin
+
+set GIT_HOMEDIR=
+for /f %%f in ('which git') do @(
+    for /f %%d in ('cmd /c "pushd %%~dpf.. && cd"') do @set GIT_HOMEDIR=%%d
+)
+if not exist "%GIT_HOMEDIR%" goto :errhome
+
+set WGET_PROGRAM=wget
+set WGET_OPTIONS="-O%GIT_TMPFILE%"
+
+set UZIP_PROGRAM=7z
+set UZIP_OPTIONS=x -y "-o%GIT_HOMEDIR%"
+
+:download
+echo Info: Downloading archive from %GIT_DWLDURL%... 1>&2
+%WGET_PROGRAM% %WGET_OPTIONS% "%GIT_DWLDURL%"
+if not errorlevel 0 goto :errdown
+echo.
+
+:extract
+echo Info: Extracting files from %GIT_TMPFILE%... 1>&2
+%UZIP_PROGRAM% %UZIP_OPTIONS% "%GIT_TMPFILE%"
+if not errorlevel 0 goto :errxtrac
+echo.
+
+echo Info: git updated successfully! 1>&2
+goto :eof
+
+:syntax
+echo. 1>&2
+echo Fatal: invalid number of arguments 1>&2
+echo. 1>&2
+echo   Syntax: %NAME% ^<download-url^> 1>&2
+goto :eof
+
+:errhome
+echo. 1>&2
+echo Fatal: Unable to guess the git home directory 1>&2
+echo. 1>&2
+goto :eof
+
+:errdown
+echo. 1>&2
+echo Fatal: Can't download binary tarball from %GIT_DWLDURL% 1>&2
+echo. 1>&2
+goto :eof
+
+:errxtrac
+echo. 1>&2
+echo Fatal: Can't extract files from the %GIT_TMPFILE% archive 1>&2
+echo. 1>&2
+goto :eof
+
+endlocal
+
+:eof