Skip to content

Commit

Permalink
Release v2.0.3: Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltimothyoh committed Oct 22, 2019
2 parents 07da0fc + 25707be commit fdeadb7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ trigger:
tags:
include:
- '*'
pr: none
pr:
branches:
include:
- '*'

resources:
repositories:
Expand Down
2 changes: 1 addition & 1 deletion build/definitions/modulemanifest/definition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Author = 'Starters Clan'
CompanyName = 'Starters Clan'
Copyright = '(c) 2019 Starters Clan'
Description = 'A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / GoldSource games.'
Description = 'A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / Goldsource games.'
PowerShellVersion = '4.0'
# PowerShellHostName = ''
# PowerShellHostVersion = ''
Expand Down
13 changes: 10 additions & 3 deletions src/Compile-SourceScript/Public/Compile-SourceScript.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Compile-SourceScript {
<#
.SYNOPSIS
A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / GoldSource games.
A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / Goldsource games.
.DESCRIPTION
Specified plugins are compiled and subsequently copied into the mod's plugins directory if found to be new or have been changed.
Expand Down Expand Up @@ -55,6 +55,9 @@ function Compile-SourceScript {
if (!$MOD_NAME) {
throw "File is not a '.sp' or '.sma' source file."
}
if (!($sourceFile.DirectoryName | Split-Path)) {
throw "The directory 'addons/$MOD_NAME/' cannot exist relative to the specified plugin source file '$($sourceFile.FullName)'."
}

# Initialize variables
$MOD = @{
Expand Down Expand Up @@ -100,10 +103,14 @@ function Compile-SourceScript {
}
$SCRIPTING_DIR = $sourceFile.DirectoryName
$COMPILED_DIR = Join-Path $SCRIPTING_DIR $MOD[$MOD_NAME]['compiled_dir_name']
$COMPILER_PATH = Join-Path $SCRIPTING_DIR $COMPILER_NAME
$PLUGINS_DIR = Join-Path (Split-Path $SCRIPTING_DIR -Parent) $MOD[$MOD_NAME]['plugins_dir_name']

# Verify the presence of the compiler item
$compiler = Get-Item -Path (Join-Path $SCRIPTING_DIR $COMPILER_NAME)
$compiler = Get-Item -Path $COMPILER_PATH -ErrorAction SilentlyContinue
if (!$compiler) {
throw "Cannot find the plugin compiler at the path '$COMPILER_PATH'."
}

}catch {
Write-Error -Exception $_.Exception -Message $_.Exception.Message -Category $_.CategoryInfo.Category -TargetObject $_.TargetObject
Expand Down Expand Up @@ -165,7 +172,7 @@ function Compile-SourceScript {
"`nNo changes to plugins were found. No operations were performed." | Write-Host -ForegroundColor Magenta
return

}else {
}else {
# List successfully compiled plugins
"`nNewly compiled plugins:" | Write-Host -ForegroundColor Cyan
$compiledDirItemsDiff | % {
Expand Down

0 comments on commit fdeadb7

Please sign in to comment.