11# output with plain text - spacing matters
22"
33 ====================================================================================
4- | Thank you for using ESDC Labels! |
4+ | Thank you for using ESDC Label Generator! |
55 | We need some information from you before we start adding labels to your project. |
66 ====================================================================================
77"
88
99# variables
10- $gitlabEnv
11- $projectId
12- $userToken
10+ $gitPlatform
1311$curlLocation
14- $GorP
1512
1613# gather info
1714
18- " Where do you have curl.exe installed?
15+ "
16+ Where do you have curl.exe installed?
19171- C:\Git\Git\mingw64\bin\curl.exe
20182- C:\Windows\System32\curl\curl.exe
21193- C:\Windows\SysWOW64\curl\curl.exe
@@ -36,39 +34,27 @@ IF ($curlSelector -eq 1) {
3634Remove-Item alias:curl
3735Set-Alias - Name curl - Value " $curlLocation "
3836
39- " Which GitLab enviornment are you using?
40- 1- GCCode
41- 2- GitLab.com
42- 0- Other"
43- $gitlabEnvSelection = Read-Host
44-
45- IF ($gitlabEnvSelection -eq 1 ) {
46- $gitlabEnv = " gccode.ssc-spc.gc.ca"
47- } ElseIf ($gitlabEnvSelection -eq 2 ) {
48- $gitlabEnv = " gitlab.com"
49- } Else {
50- $gitlabEnv = Read-Host - Prompt ' Please enter your GitLab enviornment.'
51- }
52-
53- "
54- You have chosen to use 'https://$gitlabEnv /' as your enviornment for gitlab.
55- "
56- " In order to add labels to your project we will need some info about the project or group you want to add the labels to."
57-
58- $GorP = Read-Host - Prompt ' Are you targeting a Group (G) or Project (p) for these labels? (enter G or p)'
59-
60- IF ($GorP -eq " G" ) {
61- $GorP = " groups"
62- $projectId = Read-Host - Prompt ' What is the Group ID?'
63- } Else {
64- $GorP = " projects"
65- $projectId = Read-Host - Prompt ' What is the Project ID?'
37+ $gitPlatform = " "
38+ While ($gitPlatform -eq " " ) {
39+ "
40+ Which Git platform are you using?
41+ 1- GitHub
42+ 2- GitLab
43+ (Sorry, we don't support any other platforms at the moment.)"
44+ $gitPatformSelection = Read-Host
45+
46+ IF ($gitPatformSelection -eq 1 ) {
47+ $gitPlatform = " hub"
48+ .\scripts\hub.ps1
49+ } ElseIf ($gitPatformSelection -eq 2 ) {
50+ $gitPlatform = " lab"
51+ .\scripts\lab.ps1
52+ } Else {
53+ " Sorry, you must select one of the options to continue."
54+ }
6655}
6756
68- $userToken = Read-Host - Prompt ' What is your User Token?'
6957
70- # # select and add labels
71- .\scripts\select.ps1 $userToken " https://$gitlabEnv /api/v4/$GorP /$projectId /labels"
7258
7359"
7460 Thanks for using ESDC Labels!
0 commit comments