Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: docs/src/common_demo_functions.sh

Issue 234733003: Improvements and bugfixes to the depot_tools doc generation process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « docs/man7/depot_tools_tutorial.7 ('k') | docs/src/depot_tools_tutorial.demo.tldr.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 REMOTE=$(pwd)/demo_repo 3 REMOTE=$(pwd)/demo_repo
4 4
5 unset GIT_DIR 5 unset GIT_DIR
6 6
7 # Helper functions 7 # Helper functions
8 set_user() { 8 set_user() {
9 export GIT_AUTHOR_EMAIL="$1@chromium.org" 9 export GIT_AUTHOR_EMAIL="$1@chromium.org"
10 export GIT_AUTHOR_NAME="$1" 10 export GIT_AUTHOR_NAME="$1"
(...skipping 29 matching lines...) Expand all
40 print " ".join(map(pipes.quote, sys.argv[1:]))' "$@")" 40 print " ".join(map(pipes.quote, sys.argv[1:]))' "$@")"
41 } 41 }
42 42
43 # run a visible command 43 # run a visible command
44 run() { 44 run() {
45 pcommand "$@" 45 pcommand "$@"
46 "$@" 46 "$@"
47 } 47 }
48 48
49 comment() { 49 comment() {
50 echo "# $@" 50 echo "###COMMENT### $@"
51 } 51 }
52 52
53 # run a silent command 53 # run a silent command
54 silent() { 54 silent() {
55 if [[ $DEBUG ]] 55 if [[ $DEBUG ]]
56 then 56 then
57 "$@" 57 "$@"
58 else 58 else
59 "$@" > /dev/null 2> /dev/null 59 "$@" > /dev/null 2> /dev/null
60 fi 60 fi
61 } 61 }
62 62
63 # add a file with optionally content 63 # add a file with optionally content
64 add() { 64 add() {
65 local CONTENT=$2 65 local CONTENT=$2
66 if [[ ! $CONTENT ]] 66 if [[ ! $CONTENT ]]
67 then 67 then
68 CONTENT=$(python -c 'import random, string; \ 68 CONTENT=$(python -c 'import random, string; \
69 print "".join(random.sample(string.lowercase, 16))') 69 print "".join(random.sample(string.lowercase, 16))')
70 fi 70 fi
71 echo "$CONTENT" > $1 71 echo "$CONTENT" > $1
72 silent git add $1 72 silent git add $1
73 } 73 }
74 74
75 # Add a special callout marker at the given line offset to indicate to 75 # Add a special callout marker at the given line offset to indicate to
76 # filter_demo_output.py to add a callout at that offset. 76 # filter_demo_output.py to add a callout at that offset.
77 callout() { 77 callout() {
78 echo -e "\x1b[${1}c" 78 echo -e "\x1b[${1}c"
79 } 79 }
OLDNEW
« no previous file with comments | « docs/man7/depot_tools_tutorial.7 ('k') | docs/src/depot_tools_tutorial.demo.tldr.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698