From 15190b194d55c36b6124744753d3fbdecffdccf0 Mon Sep 17 00:00:00 2001 From: Nicholas Gautier Date: Sat, 11 Jan 2025 00:14:04 -0700 Subject: [PATCH] Changed Bullet Point Messages in __PrerequisiteCheck() Changed what messages that are shown to the user in [Builder]::__PrerequisiteCheck() at each step. Now it will show what it is doing before it does the task, but will also show if the check had passed or failed afterwards. #123 --- Scripts/Builder.ps1 | 109 +++++++++++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 42 deletions(-) diff --git a/Scripts/Builder.ps1 b/Scripts/Builder.ps1 index 08efbcf..b4455ff 100644 --- a/Scripts/Builder.ps1 +++ b/Scripts/Builder.ps1 @@ -269,6 +269,16 @@ class Builder + # Show that the Project's Source Path is being checked. + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::InProgress, ` + "Looking for the Project Path:"); + [Builder]::__DisplayBulletListMessage(3, ` + [FormattedListBuilder]::NoSymbol, ` + [ProjectInformation]::GetSourcePath()); + + + # Can we find the project's source files? if (![CommonIO]::CheckPathExists([ProjectInformation]::GetSourcePath(), $true)) { @@ -281,13 +291,10 @@ class Builder # Show that the Project's source files could not be found. [Builder]::__DisplayBulletListMessage(2, ` [FormattedListBuilder]::Failure, ` - "Unable to find $([ProjectInformation]::GetProjectName()) source files!"); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "Please load a project into $($GLOBAL:_PROGRAMNAMESHORT_)!"); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "Unable to compile $([ProjectInformation]::GetProjectName()) at this time."); + "Unable to find the Project Path!"); + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::Failure, ` + "Unable to compile $([ProjectInformation]::GetProjectName())!"); @@ -340,12 +347,7 @@ class Builder # Successfully found project files [Builder]::__DisplayBulletListMessage(2, ` [FormattedListBuilder]::Successful, ` - "Found $([ProjectInformation]::GetProjectName()) source files!"); - - # Show the path to the project's source files - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - [ProjectInformation]::GetSourcePath()); + "Found the Project Path!"); @@ -356,25 +358,32 @@ class Builder - # Can we find the output path? + # Show that the Parent Output Path is being checked. + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::InProgress, ` + "Looking for the Parent Output Path:"); + [Builder]::__DisplayBulletListMessage(3, ` + [FormattedListBuilder]::NoSymbol, ` + $GLOBAL:_OUTPUT_BUILDS_PATH_); + + + + # Can we find the Parent output path? if (![CommonIO]::CheckPathExists($GLOBAL:_OUTPUT_BUILDS_PATH_, $true)) { - # Unable to find the output path directory; unable to continue. + # Unable to find the Parent output path directory; unable to continue. # Alert the user that an error had been reached. [NotificationAudible]::Notify([NotificationAudibleEventType]::Error); - # Show that the Output Directory could not be found. + # Show that the Parent Output Directory could not be found. [Builder]::__DisplayBulletListMessage(2, ` [FormattedListBuilder]::Failure, ` - "Unable to find the Output Directory!"); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "It seems $($GLOBAL:_PROGRAMNAMESHORT_) couldn't create $($GLOBAL:_OUTPUT_BUILDS_PATH_)...."); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "Unable to compile $([ProjectInformation]::GetProjectName()) at this time."); + "Unable to find the Parent Output Path!"); + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::Failure, ` + "Unable to compile $([ProjectInformation]::GetProjectName())!"); @@ -390,14 +399,14 @@ class Builder "`t$($GLOBAL:_OUTPUT_BUILDS_PATH_)"); # Generate the initial message - [string] $logMessage = "Unable to find the Output Directory!"; + [string] $logMessage = "Unable to find the Parent Output Directory!"; # Generate any additional information that might be useful - [string] $logAdditionalMSG = ("The Output Directory does not seem to exist....`r`n" + ` + [string] $logAdditionalMSG = ("The Parent Output Directory does not seem to exist....`r`n" + ` "`tPlease make sure that you have the sufficient privileges to create " + ` "folders in:`r`n" + ` "`t`t" + $(FetchPathUserDocuments) + "`r`n" + ` - "`tOutput Path is:`r`n" + ` + "`tParent Output Path is:`r`n" + ` "`t`t" + $GLOBAL:_OUTPUT_BUILDS_PATH_ + "`r`n" + ` "`tPowerShell Core Version:`r`n" + ` "`t`t" + [SystemInformation]::PowerShellVersion() + "`r`n" + ` @@ -425,22 +434,17 @@ class Builder # * * * * * * * * * * * * * * * * * * * - # Because we cannot find the output directory, we have no place to store the compile build. + # Because we cannot find the Parent output directory, we have no place to store the compile build. # We cannot continue this operation. return $false; - } # if : Check Output Path exists + } # if : Check Parent Output Path exists - # Successfully found output directory + # Successfully found Parent output directory [Builder]::__DisplayBulletListMessage(2, ` [FormattedListBuilder]::Successful, ` - "Found the Output Directory!"); - - # Show the path of the output directory path. - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - $GLOBAL:_OUTPUT_BUILDS_PATH_); + "Found the Parent Output Path!"); @@ -451,6 +455,16 @@ class Builder + # Show that the Compression PowerShell Module is being checked. + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::InProgress, ` + "Detecting the Compression PowerShell Module:"); + [Builder]::__DisplayBulletListMessage(3, ` + [FormattedListBuilder]::NoSymbol, ` + "Microsoft.PowerShell.Archive"); + + + # Make sure that the Compression POSH Module exists. if (![ArchiveZip]::DetectCompressModule()) { @@ -463,13 +477,10 @@ class Builder # Show that this program cannot detect the compression PowerShell Module. [Builder]::__DisplayBulletListMessage(2, ` [FormattedListBuilder]::Failure, ` - "Unable to find the Compression PowerShell Module!"); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "Please make sure that you have the latest version of PowerShell Core."); - [Builder]::__DisplayBulletListMessage(3, ` - [FormattedListBuilder]::NoSymbol, ` - "Unable to compile $([ProjectInformation]::GetProjectName()) at this time."); + "Unable to detect the Compression PowerShell Module!"); + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::Failure, ` + "Unable to compile $([ProjectInformation]::GetProjectName())!"); @@ -520,6 +531,20 @@ class Builder + # Successfully detected the Compression PowerShell Module + [Builder]::__DisplayBulletListMessage(2, ` + [FormattedListBuilder]::Successful, ` + "Detected the Compression PowerShell Module!"); + + + + + # Finished + # * * * * * * * * * * * * * * * * * * * * + # * * * * * * * * * * * * * * * * * * * * + + + # If we made it this far, than we found everything we need to do compile this project! [Builder]::__DisplayBulletListMessage(1, ` [FormattedListBuilder]::Successful, `