-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.py
More file actions
44 lines (37 loc) · 1.78 KB
/
Main.py
File metadata and controls
44 lines (37 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
#####################################
# Author: Anoop Singh #
# Email: anoop.singh@salesforce.com #
# Date: 03-28-2018 #
#####################################
from __future__ import print_function
class Main(object):
@classmethod
def main(cls, args):
try:
gitRepoBranchNames = raw_input("Enter Git Repo(s) Name/Checkout Branch Name:: ")
currentMinApiVersion = raw_input("Current Minimum API version:: ")
newApiVersion = raw_input("What API version to update with:: ")
# String enteredPassword = new String(console.readPassword("Please enter your ssh passphrase:: "));
# print("enteredPassword:" + enteredPassword);
commands = []
parts = gitRepoBranchNames.split(",")
for gitRepoBranchName in parts:
command = Command()
commands.append(command)
command.setCurrentApiVersion(currentMinApiVersion)
command.setNewApiVersion(newApiVersion)
repoBranchArray = gitRepoBranchName.split("/")
command.setRepoName(repoBranchArray[0].strip())
command.setBranchName(repoBranchArray[1].strip())
for command in commands:
cliGit = CLIGit(command)
cliGit.execute()
except Exception as e:
traceback.print_exc(file=sys.stdout)
print("Usage: " + "Repo Name/Checkout Branch Name (e.g. Appstore_om/work-214, Appstore_Renewals/develop)" + "\nCurrent Minimum Api Version: (e.g. 39)" + "\nNew Api Version: (e.g. 41)")
if __name__ == '__main__':
import sys, traceback
from classes.Command import Command
from classes.CLIGit import CLIGit
Main.main(sys.argv)