Sha256: 0193e1d8c392168ea894e9892f924aef1ec6e74c5f3c3825a9771cdc422dded2

Contents?: true

Size: 1.41 KB

Versions: 45

Compression:

Stored size: 1.41 KB

Contents

#!/usr/bin/env bash

REMOTE=$(pwd)/demo_repo

unset GIT_DIR

# Helper functions
set_user() {
  export GIT_AUTHOR_EMAIL="$1@chromium.org"
  export GIT_AUTHOR_NAME="$1"
  export GIT_COMMITTER_EMAIL="$1@chromium.org"
  export GIT_COMMITTER_NAME="$1"
}
set_user 'local'


# increment time by X seconds
TIME=1397119976
tick() {
  TIME=$[$TIME + $1]
  export GIT_COMMITTER_DATE="$TIME +0000"
  export GIT_AUTHOR_DATE="$TIME +0000"
}
tick 0

# a commit
c() {
  silent git commit --allow-empty -m "$1"
  tick 10
}

praw() {
  echo -e "\x1B[37;1m$ $@\x1B[m"
}

# print a visible command (but don't run it)
pcommand() {
  praw "$(python -c '\
    import sys, pipes; \
    print " ".join(map(pipes.quote, sys.argv[1:]))' "$@")"
}

# run a visible command
run() {
  pcommand "$@"
  "$@"
}

comment() {
  echo "###COMMENT### $@"
}

# run a command and print its output without printing the command itself
output() {
  "$@"
}

# run a silent command
silent() {
  if [[ $DEBUG ]]
  then
    "$@"
  else
    "$@" > /dev/null 2> /dev/null
  fi
}

# add a file with optionally content
add() {
  local CONTENT=$2
  if [[ ! $CONTENT ]]
  then
    CONTENT=$(python -c 'import random, string; \
      print "".join(random.sample(string.lowercase, 16))')
  fi
  echo "$CONTENT" > $1
  silent git add $1
}

# Add a special callout marker at the given line offset to indicate to
# filter_demo_output.py to add a callout at that offset.
callout() {
  echo -e "\x1b[${1}c"
}

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
libv8-7.8.279.23.0beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-7.4.288.28.0beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-7.3.492.27.3beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-7.3.492.27.1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-7.3.492.27.0 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-7.3.492.27.0beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.7.288.46.1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.7.288.46.0 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.7.288.46.1beta0 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.3.292.48.1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.3.292.48.0 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.3.292.48.0beta2 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.3.292.48.0beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.2.414.42.1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.2.414.42.0 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.2.414.42.0beta1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.0.286.54.3 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.0.286.54.2 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.0.286.54.1 vendor/depot_tools/man/src/common_demo_functions.sh
libv8-6.0.286.54.0 vendor/depot_tools/man/src/common_demo_functions.sh