(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:currentVersion) op:Equal rhs:{(DQ (1.11.1))} spids:[7])] spids: [7] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:configuredClient) op:Equal rhs:{(DQ )} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:private) op:Equal rhs:{(DQ (0))} spids:[16])] spids: [16] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:all) op:Equal rhs:{(DQ (0))} spids:[24])] spids: [24] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-d)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (C {(rm)} {(-rf)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp)}) terminator: <Op_Semi ';'> ) ] spids: [16777215 43] ) ] spids: [16777215 53] ) (FuncDef name: getConfiguredClient body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(curl)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (curl))} spids: [86] ) ] spids: [86] ) ] spids: [16777215 83] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(wget)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (wget))} spids: [108] ) ] spids: [108] ) ] spids: [92 105] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(fetch)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (fetch))} spids: [130] ) ] spids: [130] ) ] spids: [114 127] ) ] else_action: [ (C {(echo)} {(DQ ('Error: This tool reqires either curl, wget, or fetch to be installed.'))} ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [136 151] ) ] spids: [67] ) spids: [63 66] ) (FuncDef name: checkInternet body: (BraceGroup children: [ (Pipeline children: [ (C {(echo)} {(-e)} {(DQ ('GET http://google.com HTTP/1.0') (Lit_Other '\\') (n) (Lit_Other '\\') (n))} ) (SimpleCommand words: [{(nc)} {(google.com)} {(80)}] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) ] negated: F ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] spids: [16777215 208] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ('Error: no active internet connection'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [219 240] ) ] spids: [161] ) spids: [157 160] ) (FuncDef name: httpGet body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Name '$configuredClient'))} arms: [ (case_arm pat_list: [{(curl)}] action: [(C {(curl)} {(-A)} {(curl)} {(-s)} {(DQ ($ VSub_At '$@'))})] spids: [264 265 278 16777215] ) (case_arm pat_list: [{(wget)}] action: [(C {(wget)} {(-qO-)} {(DQ ($ VSub_At '$@'))})] spids: [281 282 291 16777215] ) (case_arm pat_list: [{(fetch)}] action: [(C {(fetch)} {(-o)} {(DQ (...))})] spids: [294 295 304 16777215] ) ] spids: [255 261 307] ) ] spids: [252] ) spids: [248 251] ) (FuncDef name: update body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repositoryName) op: Equal rhs: {(DQ (Bash-Snippets))} spids: [332] ) ] spids: [332] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:githubUserName) op: Equal rhs: {(DQ (alexanderepstein))} spids: [341] ) ] spids: [341] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameOfInstallFile) op: Equal rhs: {(DQ (install.sh))} spids: [350] ) ] spids: [350] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:latestVersion) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(httpGet)} {(https) (Lit_Other ':') (//api.github.com/repos/) ($ VSub_Name '$githubUserName') (/) ($ VSub_Name '$repositoryName') (/tags) } ) (C {(grep)} {(-Eo)} {(SQ <'"name":.*?[^\\\\]",'>)}) (C {(head)} {(-1)}) (C {(grep)} {(-Eo)} {(DQ ('[0-9.]+'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [360 396] ) } spids: [359] ) ] spids: [359] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$currentVersion')} right: {(DQ )} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$repositoryName')} right: {(DQ )} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$githubUserName')} right: {(DQ )} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$nameOfInstallFile')} right: {(DQ )} ) ) ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: update utility has not been configured correctly.'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 443] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$latestVersion')} right: {(DQ )} ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ('Error: no active internet connection'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [461 474] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name '$latestVersion'))} right: {(DQ ($ VSub_Name '$currentVersion'))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$latestVersion') (' available'))}) (C {(echo)} {(-n)} { (DQ ('Do you wish to update ') ($ VSub_Name '$repositoryName') (' [Y/n]: ')) } ) (C {(read)} {(-r)} {(answer)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name '$answer'))} right: {(DQ (Y))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name '$answer'))} right: {(DQ (y))} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(TildeSubPart token:<Lit_TildeLike '~'>)}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [580] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_d child: {(Lit_TildeLike '~') (/) ($ VSub_Name '$repositoryName') } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (AndOr ops: [Op_DPipe] children: [ (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ( 'Permissions Error: try running the update as sudo' ) ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [624] ) ] ) terminator: <Op_Semi ';'> ) ] spids: [16777215 612] ) ] spids: [16777215 642] ) (AndOr ops: [Op_DPipe] children: [ (C {(git)} {(clone)} { (DQ ('https://github.com/') ($ VSub_Name '$githubUserName') (/) ($ VSub_Name '$repositoryName') ) } ) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ("Couldn't download latest version"))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [658] ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [682] ) ] ) (AndOr ops: [Op_DPipe Op_DPipe] children: [ (SimpleCommand words: [ {(git)} {(checkout)} {(DQ (v) ($ VSub_Name '$latestVersion'))} ] redirects: [ (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (SimpleCommand words: [{(git)} {(checkout)} {(DQ ($ VSub_Name '$latestVersion'))}] redirects: [ (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(echo)} { (DQ ( "Couldn't git checkout to stable release, updating to latest commit." ) ) } ) ] ) (C {(chmod)} {(a) (Lit_Other '+') (x)} {(install.sh)}) (AndOr ops: [Op_DPipe] children: [ (C {(./) ($ VSub_Name '$nameOfInstallFile')} {(DQ (update))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(cd)} {(..)}) (AndOr ops: [Op_DPipe] children: [ (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ( 'Permissions Error: update succesfull but cannot delete temp files located at ~/' ) ($ VSub_Name '$repositoryName') (' delete this directory with sudo') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [777] ) ] ) ] spids: [16777215 571] ) ] else_action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] spids: [796 804] ) ] spids: [16777215 512] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_Name '$repositoryName') (' is already the latest version'))} ) ] spids: [807 818] ) ] spids: [492 821] ) ] spids: [317] ) spids: [313 316] ) (FuncDef name: getBitbucketInfo body: (BraceGroup children: [ (C {(echo)} {(-n)} {(SQ <'Enter your Bitbucket username: '>)}) (C {(read)} {(bbUsername)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$bbUsername')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(echo)} {(DQ ('Using github username as bitbucket username'))})] spids: [16777215 865] ) ] spids: [16777215 875] ) (C {(echo)} {(-n)} {(SQ <'Enter your Bitbucket password: '>)}) (C {(read)} {(-s)} {(password)}) ] spids: [834] ) spids: [830 833] ) (FuncDef name: backupRepo body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:timestamp) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(date)}) (C {(tr)} {(DQ (' '))} {(_)}) (C {(tr)} {(Lit_Other ':')} {(_)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [907 928] ) } spids: [906] ) ] spids: [906] ) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp/github/) ($ VSub_Name '$repoName')} ) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ('Fatal error'))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [942] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$private')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(httpGet)} {(--user)} {($ VSub_Name '$bbUsername') (Lit_Other ':') ($ VSub_Name '$password')} {(https) (Lit_Other ':') (//api.bitbucket.org/1.0/repositories/)} {(--data)} {(Lit_VarLike 'name=') ($ VSub_Name '$repoName') ($ VSub_Name '$timestamp')} {(Lit_VarLike 'is_private=') (true)} ] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(echo)} {(DQ (private))}) ] spids: [16777215 973] ) ] else_action: [ (SimpleCommand words: [ {(httpGet)} {(--user)} {($ VSub_Name '$bbUsername') (Lit_Other ':') ($ VSub_Name '$password')} {(https) (Lit_Other ':') (//api.bitbucket.org/1.0/repositories/)} {(--data)} {(Lit_VarLike 'name=') ($ VSub_Name '$repoName') ($ VSub_Name '$timestamp')} ] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) ] spids: [1009 1035] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:originalRepoName) op: Equal rhs: {($ VSub_Name '$repoName')} spids: [1038] ) ] spids: [1038] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoName) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$repoName')}) (C {(tr)} {(SQ <'[:upper:]'>)} {(SQ <'[:lower:]'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1043 1059] ) } spids: [1042] ) ] spids: [1042] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:timestamp) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$timestamp')}) (C {(tr)} {(SQ <'[:upper:]'>)} {(SQ <'[:lower:]'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1063 1079] ) } spids: [1062] ) ] spids: [1062] ) (AndOr ops: [Op_DPipe] children: [ (SimpleCommand words: [ {(git)} {(remote)} {(set-url)} {(origin)} {(https) (Lit_Other ':') (//) ($ VSub_Name '$bbUsername') (Lit_Other ':') ($ VSub_Name '$password') (Lit_Other '@') (bitbucket.org/) ($ VSub_Name '$bbUsername') (/) ($ VSub_Name '$repoName') ($ VSub_Name '$timestamp') (.git) } ] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (C {(echo)} {(DQ ('Uploading ') ($ VSub_Name '$originalRepoName') (' to bitbucket'))}) (AndOr ops: [Op_DPipe] children: [ (SimpleCommand words: [{(git)} {(push)} {(-q)} {(--progress)} {(origin)} {(--all)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (C {(echo)} {(DQ ('Uploading the tags for ') ($ VSub_Name '$originalRepoName'))}) (AndOr ops: [Op_DPipe] children: [ (SimpleCommand words: [{(git)} {(push)} {(-q)} {(--progress)} {(origin)} {(--tags)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (C {(echo)} {(DQ ('Successfully backedup ') ($ VSub_Name '$originalRepoName'))}) (C {(rm)} {(-rf)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp)}) ] spids: [903] ) spids: [899 902] ) (FuncDef name: getGitHubRepoInfo body: (BraceGroup children: [ (C {(echo)} {(-n)} {(SQ <'Enter the name of the repostiory to backup: '>)}) (C {(read)} {(repoName)}) ] spids: [1216] ) spids: [1212 1215] ) (FuncDef name: getGitHubUserInfo body: (BraceGroup children: [ (C {(echo)} {(-n)} {(SQ <'Enter your Github username: '>)}) (C {(read)} {(ghUsername)}) ] spids: [1242] ) spids: [1238 1241] ) (FuncDef name: cloneGitHubRepo body: (BraceGroup children: [ (C {(mkdir)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp)}) (AndOr ops: [Op_DPipe] children: [ (C {(cd)}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ('Fatal error'))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [1281] ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(mkdir)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp/github)}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ('Fatal error'))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [1305] ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(TildeSubPart token:<Lit_TildeLike '~'>) (/temp/github)}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ('Fatal error'))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [1329] ) ] ) (C {(echo)} {(DQ ('Cloning ') ($ VSub_Name '$repoName'))}) (AndOr ops: [Op_DPipe] children: [ (C {(git)} {(clone)} {(-q)} {(--progress)} {(https) (Lit_Other ':') (//github.com/) ($ VSub_Name '$ghUsername') (/) ($ VSub_Name '$repoName') } ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (C {(echo)} {(DQ ('Successfully cloned ') ($ VSub_Name '$repoName'))}) ] spids: [1268] ) spids: [1264 1267] ) (FuncDef name: getGithubRepoNames body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:response) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(httpGet)} { (DQ ('https://api.github.com/users/') ($ VSub_Name '$ghUsername') ('/repos?sort=updated&per_page=100') ) } ) (C {(grep)} {(-Eo)} {(SQ <'"name": "[ a-Z . \\/ \\\\ 0-9 -- _ ]*'>)}) (C {(sed)} {(s/) (SQ <'"name": "'>) (/) (DQ ) (/g)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1397 1428] ) } spids: [1396] ) ] spids: [1396] ) (ForEach iter_name: repo iter_words: [{($ VSub_Name '$response')}] do_arg_iter: F body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoNames) op: PlusEqual rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_Name '$repo'))}])} spids: [1443] ) ] spids: [1443] ) ] spids: [1440 1451] ) spids: [1436 16777215] ) ] spids: [1393] ) spids: [1389 1392] ) (FuncDef name: usage body: (BraceGroup children: [ (C {(echo)} {(DQ (Cloudup))}) (C {(echo)} {(DQ ('Description: Backs up a users github repositories to your bitbucket account.'))} ) (C {(echo)} { (DQ (' With no flags cloudup will guide you through backing up a single repository')) } ) (C {(echo)} {(DQ ('Usage: cloudup [flags] or cloudup [flags] [listOfGHRepoNamesSplitBySpaces]'))} ) (C {(echo)} { (DQ ( ' -p Upload the repositor(y)(ies) as private to bitbucket (must have private repo ability on bitbucket)' ) ) } ) (C {(echo)} {(DQ (' -a Backup all github repositories'))}) (C {(echo)} {(DQ (' -u Update Bash-Snippet Tools'))}) (C {(echo)} {(DQ (' -h Show the help'))}) (C {(echo)} {(DQ (' -v Get the tool version'))}) (C {(echo)} {(DQ ('Examples:'))}) (C {(echo)} {(DQ (' cloudup'))}) (C {(echo)} {(DQ (' cloudup -p -a'))}) (C {(echo)} {(DQ (' cloudup -p nameOfRepo1 nameOf Repo2'))}) (C {(echo)} {(DQ (' cloudup nameOfRepo'))}) ] spids: [1460] ) spids: [1456 1459] ) (AndOr ops: [Op_DPipe] children: [(C {(getConfiguredClient)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (AndOr ops: [Op_DPipe] children: [(C {(checkInternet)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (WhileUntil keyword: <KW_While while> cond: [(Sentence child:(C {(getopts)} {(DQ (pauvh))} {(opt)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(EscapedLiteralPart token:<Lit_EscapedChar '\\?'>)}] action: [ (SimpleCommand words: [{(echo)} {(DQ ('Invalid option: -') ($ VSub_Name '$OPTARG'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [1601 1602 1621 16777215] ) (case_arm pat_list: [{(p)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:private) op: Equal rhs: {(DQ (1))} spids: [1628] ) ] spids: [1628] ) (SimpleCommand words: [ {(echo)} { (DQ ( 'Feature not added yet, for now all backups must be public (can be manually set to private through bitbucket after backup)' ) ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [1624 1625 1649 16777215] ) (case_arm pat_list: [{(h)}] action: [(C {(usage)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [1652 1653 1664 16777215] ) (case_arm pat_list: [{(a)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:all) op: Equal rhs: {(DQ (1))} spids: [1671] ) ] spids: [1671] ) ] spids: [1667 1668 1677 16777215] ) (case_arm pat_list: [{(v)}] action: [ (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$currentVersion'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [1680 1681 1697 16777215] ) (case_arm pat_list: [{(u)}] action: [(C {(update)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [1700 1701 1712 16777215] ) (case_arm pat_list: [{(Lit_Other ':')}] action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Option -') ($ VSub_Name '$OPTARG') (' requires an argument.'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [1715 1716 1736 16777215] ) ] spids: [1594 1598 1739] ) ] spids: [1591 1741] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Pound '$#')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$1')} right: {(DQ (update))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(update)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [16777215 1778] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$1')} right: {(DQ (help))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [1789 1804] ) ] spids: [16777215 1815] ) ] spids: [16777215 1761] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ge)} {(1)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getGitHubUserInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(getBitbucketInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (C {(echo)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_Name '$private')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (ForEach iter_name: i iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: F body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoName) op: Equal rhs: {($ VSub_Name '$i')} spids: [1887] ) ] spids: [1887] ) (C {(echo)} {(DQ ('Starting to backup ') ($ VSub_Name '$repoName'))}) (AndOr ops: [Op_DPipe] children: [ (C {(cloneGitHubRepo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(backupRepo)}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ('Error: couldnt backup ') ($ VSub_Name '$originalRepoName') (' to bitbucket') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [1912] ) ] ) (C {(echo)}) ] spids: [1881 1934] ) spids: [1875 1879] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [16777215 1867] ) ] else_action: [ (ForEach iter_name: i iter_words: [ { (DQ (BracedVarSub token: <VSub_At '@'> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [1952 1956] ) ) } ] do_arg_iter: F body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoName) op: Equal rhs: {($ VSub_Name '$i')} spids: [1963] ) ] spids: [1963] ) (C {(echo)} {(DQ ('Starting to backup ') ($ VSub_Name '$repoName'))}) (AndOr ops: [Op_DPipe] children: [ (C {(cloneGitHubRepo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(backupRepo)}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ('Error: couldnt backup ') ($ VSub_Name '$originalRepoName') (' to bitbucket') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [1988] ) ] ) (C {(echo)}) ] spids: [1960 2010] ) spids: [1950 1958] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [1942 2018] ) ] spids: [1817 1829] ) ] spids: [16777215 2020] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$all')} right: {(DQ (0))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{($ VSub_Number '$1')} right:{(DQ )}) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getGitHubUserInfo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(getGitHubRepoInfo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(getBitbucketInfo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(echo)}) (AndOr ops: [Op_DPipe] children: [ (C {(cloneGitHubRepo)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(backupRepo)}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ('Error: couldnt backup ') ($ VSub_Name '$originalRepoName') (' to bitbucket') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [2100] ) ] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [16777215 2054] ) ] else_action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getGitHubUserInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoName) op: Equal rhs: {($ VSub_Number '$1')} spids: [2136] ) ] spids: [2136] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(getBitbucketInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (C {(echo)}) (AndOr ops: [Op_DPipe] children: [ (C {(cloneGitHubRepo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(backupRepo)}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ('Error: couldnt backup ') ($ VSub_Name '$originalRepoName') (' to bitbucket') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [2171] ) ] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [2124 2195] ) ] spids: [16777215 2038] ) ] else_action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getGitHubUserInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(getGithubRepoNames)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [(C {(getBitbucketInfo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (C {(echo)}) (ForEach iter_name: repo iter_words: [ { (DQ (BracedVarSub token: <VSub_Name repoNames> bracket_op: (WholeArray op_id:Lit_At) spids: [2237 2242] ) ) } ] do_arg_iter: F body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repoName) op: Equal rhs: {($ VSub_Name '$repo')} spids: [2249] ) ] spids: [2249] ) (C {(echo)} {(DQ ('Starting to backup ') ($ VSub_Name '$repoName'))}) (AndOr ops: [Op_DPipe] children: [ (C {(cloneGitHubRepo)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(backupRepo)}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ('Error: couldnt backup ') ($ VSub_Name '$repoName') (' to bitbucket') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] spids: [2274] ) ] ) (C {(echo)}) ] spids: [2246 2296] ) spids: [2235 16777215] ) (C {(echo)} {(DQ ('Successfully backed up all repositories'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [2197 2311] ) ] )