-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUpdateRepo_codedoc_resources_25_12.ps1
More file actions
108 lines (88 loc) · 4.88 KB
/
UpdateRepo_codedoc_resources_25_12.ps1
File metadata and controls
108 lines (88 loc) · 4.88 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This script checks out at ../codedoc_resources the repository that
# contains Doxygen and Graphviz binaries necessary to generate code
# documentation, from the repository codedoc_resources_25_12. This
# repository contais newer version of binaries but needs Git LFS. See the
# README.md at
# https://github.com/ajgorhoe/codedoc_resources_25_12/blob/main/README.md
<#
.SYNOPSIS
Updates or clones a specific repository by calling UpdateOrCloneRepository.ps1
with parameters set through global variables.
.DESCRIPTION
This script defines a set of variables named with the 'CurrentRepo_' prefix in
the same order as UpdateOrCloneRepository.ps1 parameters. Then, it invokes
UpdateOrCloneRepository.ps1 *without* passing parameters, relying on
-DefaultFromVars to pick up the values from these global variables.
When repository directory is specified as relative path, path is
resolved with the scrit directory as base path.
.NOTES
Make sure UpdateOrCloneRepository.ps1 is accessible at the path specified in
$UpdatingScriptPath (absolute or relative).
#>
Write-Host "`n`n======================================================="
Write-Host "Updating/cloning a specific repository..."
########################################################################
# Custom section (USER DEFINED):
# Path to UpdateOrCloneRepository.ps1
$UpdatingScriptPath = "./UpdateOrCloneRepository.ps1"
# Define parameter variables for UpdateOrCloneRepository.ps1
# in the same order as that script's parameters:
$global:CurrentRepo_Directory = "../codedoc_resources/"
$global:CurrentRepo_Ref = "main"
$global:CurrentRepo_Address = "https://github.com/ajgorhoe/codedoc_resources_25_12/"
# When adapting this repository for documenting your own dource code,
# please create your own fork of the codedoc_resources_25_12 repository
# and reference it, e.g., similar as user IOPTLib:
# https://github.com/IOptLib/codedoc_resources_25_12/
$global:CurrentRepo_Remote = "origin"
$global:CurrentRepo_AddressSecondary = $null
$global:CurrentRepo_RemoteSecondary = $null
$global:CurrentRepo_AddressTertiary = $null
# "d:/backup_sync/bk_code/git/ig/misc/iglib_modules/IGLibScripting"
$global:CurrentRepo_RemoteTertiary = "local"
$global:CurrentRepo_ThrowOnErrors = $false
# End of custom section
########################################################################
# $global:CurrentRepo_DefaultFromVars = $true # params set from variables above
$global:CurrentRepo_BaseDirectory = $null # base dir will be set to script dir
# Set CurrentRepo_BaseDirectory to the directory containing this script:
$scriptPath = $MyInvocation.MyCommand.Path
$scriptDir = Split-Path $scriptPath -Parent
$scriptFilename = [System.IO.Path]::GetFileName($scriptPath)
# Set base directory for relative paths to the current script's directory:
$global:CurrentRepo_BaseDirectory = $scriptDir
# If $UpdatingScriptPath is a relative path, convert it to absolute
if (-not [System.IO.Path]::IsPathRooted($UpdatingScriptPath)) {
$UpdatingScriptPath = Join-Path $scriptDir $UpdatingScriptPath
}
# Write-Host "`n${scriptFilename}:"
# Write-Host " CurrentRepo_Directory: $CurrentRepo_Directory"
# Write-Host " CurrentRepo_Address: $CurrentRepo_Address"
# Write-Host " CurrentRepo_Ref: $CurrentRepo_Ref"
# # Write-Host " UpdatingScriptPath: $UpdatingScriptPath"
# # Write-Host " CurrentRepo_BaseDirectory: $CurrentRepo_BaseDirectory `n"
# Print all variables used as settings for updating / cloning repositories:
Write-Host "-------------------------------------------------------"
Write-Host "Variables for repository updating / cloning scripts:"
Write-Host " CurrentRepo_Directory: $CurrentRepo_Directory"
Write-Host " CurrentRepo_Ref: $CurrentRepo_Ref"
Write-Host " CurrentRepo_Address: $CurrentRepo_Address"
Write-Host " CurrentRepo_Remote: $CurrentRepo_Remote"
Write-Host " CurrentRepo_AddressSecondary: $CurrentRepo_AddressSecondary"
Write-Host " CurrentRepo_RemoteSecondary: $CurrentRepo_RemoteSecondary"
Write-Host " CurrentRepo_AddressTertiary: $CurrentRepo_AddressTertiary"
Write-Host " CurrentRepo_RemoteTertiary: $CurrentRepo_RemoteTertiary"
Write-Host " CurrentRepo_ThrowOnErrors: $CurrentRepo_ThrowOnErrors"
#
Write-Host " CurrentRepo_DefaultFromVars: $CurrentRepo_DefaultFromVars"
Write-Host " CurrentRepo_BaseDirectory : $CurrentRepo_BaseDirectory"
#
Write-Host "---------------------------------------------------------"
# # Uncomment the line below only when the print script exists!
# & (Join-Path $scriptDir PrintSettingsUpdateOrClone.ps1)
# Invoke UpdateOrCloneRepository.ps1 with no parameters,
# so it uses the global variables defined above:
Write-Host "`nCalling update script without parameters; it will use global variables..."
& $UpdatingScriptPath -Execute -DefaultFromVars
Write-Host "`nUpdating or cloning the repository completed."
Write-Host "---------------------------------------------------------`n`n"