From d548eb594b0f666a799ee3654ad076517a630a32 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 5 Aug 2015 18:24:01 -0400 Subject: Fix missing main() --- cbc/cli/recipe.py | 6 +++++- setup.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cbc/cli/recipe.py b/cbc/cli/recipe.py index b9a58b5..8fabe2f 100644 --- a/cbc/cli/recipe.py +++ b/cbc/cli/recipe.py @@ -10,7 +10,7 @@ RECIPE_TYPES = ['python', 'scons', 'cmake'] -if __name__ == '__main__': +def main(): parser = argparse.ArgumentParser() parser.add_argument('--style', default='python') parser.add_argument('--name', default='') @@ -161,3 +161,7 @@ if errorlevel 1 exit 1 with open(RECIPE, 'w+') as recipe: config.write(recipe) + +if __name__ == '__main__': + main() + diff --git a/setup.py b/setup.py index f45cf30..8bf8cc4 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,9 @@ cbcpkg = os.path.join('cbc', 'version.py') #Omit git hash and let setuptools add a valid build number git_version = get_git_version() -git_version = git_version[:git_version.rfind('-')] +if git_version.rfind('-') != -1: + git_version = git_version[:git_version.rfind('-')] + with open(cbcpkg, 'w+') as version_data: version_data.write('__version__ = "{0}"\n'.format(git_version)) -- cgit