Skip to content

Commit fdeadb7

Browse files
committed
Release v2.0.3: Merge branch 'dev'
2 parents 07da0fc + 25707be commit fdeadb7

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

azure-pipelines.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ trigger:
55
tags:
66
include:
77
- '*'
8-
pr: none
8+
pr:
9+
branches:
10+
include:
11+
- '*'
912

1013
resources:
1114
repositories:

build/definitions/modulemanifest/definition.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Author = 'Starters Clan'
1111
CompanyName = 'Starters Clan'
1212
Copyright = '(c) 2019 Starters Clan'
13-
Description = 'A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / GoldSource games.'
13+
Description = 'A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / Goldsource games.'
1414
PowerShellVersion = '4.0'
1515
# PowerShellHostName = ''
1616
# PowerShellHostVersion = ''

src/Compile-SourceScript/Public/Compile-SourceScript.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function Compile-SourceScript {
22
<#
33
.SYNOPSIS
4-
A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / GoldSource games.
4+
A wrapper for compiling SourceMod (.sp) and AMX Mod X (.sma) plugin source files for Source / Goldsource games.
55
66
.DESCRIPTION
77
Specified plugins are compiled and subsequently copied into the mod's plugins directory if found to be new or have been changed.
@@ -55,6 +55,9 @@ function Compile-SourceScript {
5555
if (!$MOD_NAME) {
5656
throw "File is not a '.sp' or '.sma' source file."
5757
}
58+
if (!($sourceFile.DirectoryName | Split-Path)) {
59+
throw "The directory 'addons/$MOD_NAME/' cannot exist relative to the specified plugin source file '$($sourceFile.FullName)'."
60+
}
5861

5962
# Initialize variables
6063
$MOD = @{
@@ -100,10 +103,14 @@ function Compile-SourceScript {
100103
}
101104
$SCRIPTING_DIR = $sourceFile.DirectoryName
102105
$COMPILED_DIR = Join-Path $SCRIPTING_DIR $MOD[$MOD_NAME]['compiled_dir_name']
106+
$COMPILER_PATH = Join-Path $SCRIPTING_DIR $COMPILER_NAME
103107
$PLUGINS_DIR = Join-Path (Split-Path $SCRIPTING_DIR -Parent) $MOD[$MOD_NAME]['plugins_dir_name']
104108

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

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

168-
}else {
175+
}else {
169176
# List successfully compiled plugins
170177
"`nNewly compiled plugins:" | Write-Host -ForegroundColor Cyan
171178
$compiledDirItemsDiff | % {

0 commit comments

Comments
 (0)