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

Side by Side Diff: mojo/tools/mojosh.sh

Issue 668483002: Change mojo URLs from mojo://mojo_foo to mojo://foo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This a simple script to make running Mojo shell easier (on Linux). 6 # This a simple script to make running Mojo shell easier (on Linux).
7 7
8 DIRECTORY="$(dirname "$0")"/../../out/Debug 8 DIRECTORY="$(dirname "$0")"/../../out/Debug
9 PORT=$(($RANDOM % 8192 + 2000)) 9 PORT=$(($RANDOM % 8192 + 2000))
10 10
11 do_help() { 11 do_help() {
12 cat << EOF 12 cat << EOF
13 Usage: $(basename "$0") [-d DIRECTORY] [-|--] <mojo_shell arguments ...> 13 Usage: $(basename "$0") [-d DIRECTORY] [-|--] <mojo_shell arguments ...>
14 14
15 DIRECTORY defaults to $DIRECTORY. 15 DIRECTORY defaults to $DIRECTORY.
16 16
17 Example: 17 Example:
18 $(basename "$0") mojo:mojo_sample_app 18 $(basename "$0") mojo:sample_app
19 EOF 19 EOF
20 } 20 }
21 21
22 kill_http_server() { 22 kill_http_server() {
23 echo "Killing SimpleHTTPServer ..." 23 echo "Killing SimpleHTTPServer ..."
24 kill $HTTP_SERVER_PID 24 kill $HTTP_SERVER_PID
25 wait $HTTP_SERVER_PID 25 wait $HTTP_SERVER_PID
26 } 26 }
27 27
28 while [ $# -gt 0 ]; do 28 while [ $# -gt 0 ]; do
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 cd $DIRECTORY/lib || exit 1 62 cd $DIRECTORY/lib || exit 1
63 python -m SimpleHTTPServer $PORT & 63 python -m SimpleHTTPServer $PORT &
64 # Kill the HTTP server on exit (even if the user kills everything using ^C). 64 # Kill the HTTP server on exit (even if the user kills everything using ^C).
65 HTTP_SERVER_PID=$! 65 HTTP_SERVER_PID=$!
66 trap kill_http_server EXIT 66 trap kill_http_server EXIT
67 cd .. 67 cd ..
68 68
69 echo "Running:" 69 echo "Running:"
70 echo "./mojo_shell --origin=http://127.0.0.1:$PORT --disable-cache $*" 70 echo "./mojo_shell --origin=http://127.0.0.1:$PORT --disable-cache $*"
71 ./mojo_shell --origin=http://127.0.0.1:$PORT --disable-cache $* 71 ./mojo_shell --origin=http://127.0.0.1:$PORT --disable-cache $*
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698