Changes between Version 5 and Version 6 of CommittersTipsAndTricks


Ignore:
Timestamp:
Jun 8, 2008, 3:42:08 PM (16 years ago)
Author:
raimue (Rainer Müller)
Comment:

New version of trac-get

Legend:

Unmodified
Added
Removed
Modified
  • CommittersTipsAndTricks

    v5 v6  
    2727{{{
    2828function trac-get {
    29     curl "$1?format=raw" -o $(basename $1)
     29    local url=$1
     30    local dir=$2
     31
     32    if [[ -z $dir ]]; then
     33        dir=.
     34    fi 
     35
     36    curl "$url?format=raw" --create-dirs -o $dir/$(basename $1)
    3037}
    3138
     
    6370}}}
    6471
    65 You can also add options which will get passed through to the patch tool. This is especially useful when the patch needs another prefix level.
     72You can also add options to `trac-patch` which will get passed through to the patch tool. This is especially useful when the patch needs another prefix level.
    6673{{{
    6774$ trac-patch -p1 http://trac.macports.org/attachment/ticket/.../Portfile.diff
    6875}}}
    6976If you don't add any option, `-p0` is used as a default. This should be the most common case.
     77
     78`trac-get` can also download to another directory. If the directory does not yet exist, it will be created. Just add a second parameter with the name of the directory. If you omit the second parameter, the current directory is used.
     79{{{
     80$ trac-get http://trac.macports.org/attachment/ticket/.../Portfile new-port
     81}}}