|
| 1 | +#!/bin/sh |
| 2 | +# Start of script |
| 3 | +# Automating the archival of the /RepoData/ directory |
| 4 | +# This is mainly pseudocode right now, and is not functional |
| 5 | +check_bandwidth () { |
| 6 | + $///Repo/bandwidth_band/Automation/GitHub/Bandwidth_Check/.sh |
| 7 | + return 0; |
| 8 | + break |
| 9 | +} |
| 10 | +exd () { |
| 11 | + echo "AUTOMATE-2001 will end the Create RepoData process in 10 seconds" |
| 12 | + wait(10) |
| 13 | + exit |
| 14 | + break |
| 15 | +} |
| 16 | +input () { |
| 17 | + echo "AUTOMATE-2001\nArchive/update repodata\nWhich repository would you like to update:" |
| 18 | + read "RepoName: " |
| 19 | + echo "You entered: " + $RepoName + " would you like to create or update?" |
| 20 | + set Targetrepo to $RepoName |
| 21 | + read "c/u : " |
| 22 | + if read == "C" { |
| 23 | + echo "AUTOMATE-2001 will now create an archive of the repository data for this repo, and will send a pull request when done" |
| 24 | + return $create |
| 25 | + break |
| 26 | + } fi else if read = "U" { |
| 27 | + echo "AUTOMATE-2001 will now update and archive the repository data for this repo, and will send a pull request when done" |
| 28 | + return $update |
| 29 | + break |
| 30 | + } fi else { |
| 31 | + echo "Invalid input, exiting in 10 seconds" |
| 32 | + wait(10) |
| 33 | + exit |
| 34 | + break |
| 35 | + } |
| 36 | + break |
| 37 | +} |
| 38 | +repoData_create () { |
| 39 | + read.REST($Repo_Description) |
| 40 | + fork $Repo_Description as "///RepoData/Description/GitHub/README.txt" |
| 41 | + copy "///RepoData/Description/GitHub/README.txt" to "///RepoData/Description/GitHub/OldVersions/English/US/1/1-100/README_V1.txt" |
| 42 | + fork $repoLink as "///RepoData/Link/GitHub/README.md" format as \n"```"\n"$Data"\n"```"\n"$Data"\n""\b\r\e\a\k |
| 43 | + copy "///RepoData/Link/GitHub/README.md" to "///RepoData/Link/GitHub/OldVersions/English/US/1/1-100/README_V1.md" |
| 44 | + fork $repoLinkGit as "///RepoData/Link/GitHub-Git/README.md" format as \n"```"\n"$Data"\n"```"\n"$Data"\n""\b\r\e\a\k |
| 45 | + copy "///RepoData/Link/GitHub-Git/README.md" to "///RepoData/Link/GitHub-Git/OldVersions/English/US/1/1-100/README_V1.md" |
| 46 | + fork $repoLinked as # Stopping here for now |
| 47 | + fork $topicsGit as "///RepoData/Topics/TOPICS.txt" format as \n"$Data#1"\n$Data++ until $Data=21 |
| 48 | + if $data.entry == "" { |
| 49 | + stop |
| 50 | + return 0 |
| 51 | + break |
| 52 | + } fi else { |
| 53 | + continue |
| 54 | + break |
| 55 | + } |
| 56 | + copy "///RepoData/Topics/TOPICS.txt" to "///RepoData/Topics/OldVersions/1/1-100/TOPICS_V1.txt" |
| 57 | + REST.commitTitle = "Create RepoData archive directory" |
| 58 | + REST.commitDesc = "Created RepoData archive directory. This action was done by @AUTOMATE-2001" |
| 59 | + push to "/branches/AUTOMATE-2001-RepoData-create/" |
| 60 | + return makePR_A() |
| 61 | + break |
| 62 | + } |
| 63 | +} |
| 64 | +makePR_A () { |
| 65 | + raise $pr on TargetRepo with { |
| 66 | + pr.title "RepoData creation " + $date |
| 67 | + pr.body "AUTOMATE-2001 has gone ahead and generated a RepoData archive directory on [this project]($RepoName/branch) please review the changes. After you are done, please delete or rename the branch, so that this script can be ran again in the future. If you believe you received this PR by mistake, someone may have targeted your repository without GitHub application authorization. Please report the issue to GitHub." |
| 68 | + pr.raise |
| 69 | + break |
| 70 | + } |
| 71 | +} |
| 72 | +makePR_B () { |
| 73 | + raise $pr on TargetRepo with { |
| 74 | + pr.title "RepoData creation " + $date |
| 75 | + pr.body "AUTOMATE-2001 has gone ahead and updated the existing RepoData archive directory on [this project]($RepoName/branch) please review the changes. After you are done, please delete or rename the branch, so that this script can be ran again in the future. If you believe you received this PR by mistake, someone may have targeted your repository without GitHub application authorization. Please report the issue to GitHub." |
| 76 | + pr.raise |
| 77 | + break |
| 78 | + } |
| 79 | +} |
| 80 | +return check_bandwidth() |
| 81 | +return input() |
| 82 | +read 0 |
| 83 | +exit |
| 84 | +break |
| 85 | +# File info |
| 86 | +# File type: Shell script file (*.sh) |
| 87 | +# File version: 1 (2022 Monday, February 7th at 6:55 pm) |
| 88 | +# Line count (Including blank lines and compiler line): 90 |
| 89 | +# End of script |
0 commit comments