-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclone_and_install.ps1
More file actions
45 lines (39 loc) · 1.11 KB
/
clone_and_install.ps1
File metadata and controls
45 lines (39 loc) · 1.11 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
# Set strict mode
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
# Function to check if required commands are installed
function Test-RequiredCommands {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Write-Error "Error: git is not installed. Please install git and curl to run this script."
exit 1
}
if (-not (Get-Command curl -ErrorAction SilentlyContinue)) {
Write-Error "Error: curl is not installed. Please install git and curl to run this script."
exit 1
}
}
# Function to clone the repository
function Clone-Repository {
Write-Host "Cloning eMush repository..."
git clone https://gitlab.com/eternaltwin/mush/mush.git
Set-Location mush
}
# Function to launch the install script
function Start-InstallScript {
Write-Host "Launching install script..."
.\install.ps1
}
# Main execution block
function Start-Installation {
try {
Test-RequiredCommands
Clone-Repository
Start-InstallScript
}
catch {
Write-Error "An error occurred: $_"
exit 1
}
}
# Run the script
Start-Installation