diff options
-rwxr-xr-x | scripts/shell/send-patches | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/shell/send-patches b/scripts/shell/send-patches index e15aaa8..d420357 100755 --- a/scripts/shell/send-patches +++ b/scripts/shell/send-patches @@ -1,12 +1,18 @@ #!/usr/bin/python import argparse +import os import re import subprocess import sys GIT_CONFIG_SETUP = "sugar-build.send-patches.setup" +shell_dir = os.path.abspath(os.path.dirname(__file__)) +scripts_dir = os.path.dirname(shell_dir) +root_dir = os.path.dirname(scripts_dir) +source_dir = os.path.join(root_dir, "source") + def get_git_config(name, is_global=False): args = ["git", "config"] @@ -83,6 +89,10 @@ def setup(): set_git_config(GIT_CONFIG_SETUP, "true") +if os.path.dirname(os.getcwd()) != source_dir: + print "The command must be run inside one of the source modules." + sys.exit(1) + parser = argparse.ArgumentParser() parser.add_argument("--setup", action="store_true", help="interactive configuration") |