Skip to content

Commit

Permalink
Merge pull request chocolatey#985 from st3phhays/testing-and-development
Browse files Browse the repository at this point in the history
(chocolatey#983) Simplify local development of choco-theme
  • Loading branch information
vexx32 authored May 9, 2024
2 parents d0421f8 + ce64d94 commit 41e8f65
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
3 changes: 2 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var port = Argument("port", 5080);

///////////////////////////////////////////////////////////////////////////////
// Setup
Expand Down Expand Up @@ -96,7 +97,7 @@ Task("Statiq-Preview")
Configuration = configuration
};

DotNetCoreRun(projectPath, new ProcessArgumentBuilder().Append(string.Format("preview --output \"{0}\"", buildData.OutputDirectory)), settings);
DotNetCoreRun(projectPath, new ProcessArgumentBuilder().Append(string.Format("preview --port {0} --output \"{1}\"", port, buildData.OutputDirectory)), settings);
});

Task("Statiq-Build")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"choco-theme": "yarn dlx --quiet ts-node --skipIgnore node_modules/choco-theme/build/choco-theme.ts --repository=docs"
},
"devDependencies": {
"choco-theme": "0.6.0"
"choco-theme": "0.7.0"
}
}
10 changes: 8 additions & 2 deletions preview.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
param(
[Parameter(Position = 0)]
[int]
$Port = 5080
)

try {
Push-Location $PSScriptRoot
dotnet tool restore
dotnet cake
dotnet cake --port $Port
} finally {
Pop-Location
}
}
14 changes: 13 additions & 1 deletion preview.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Default port
DEFAULT_PORT=5080

# Check if the first argument is present
if [ $# -ge 1 ]; then
# Use the first argument as the port
PORT="$1"
else
# Use the default port if no argument is provided
PORT="$DEFAULT_PORT"
fi

dotnet tool restore
dotnet cake
dotnet cake --port="$PORT"
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1552,9 +1552,9 @@ __metadata:
languageName: node
linkType: hard

"choco-theme@npm:0.6.0":
version: 0.6.0
resolution: "choco-theme@npm:0.6.0"
"choco-theme@npm:0.7.0":
version: 0.7.0
resolution: "choco-theme@npm:0.7.0"
dependencies:
"@fortawesome/fontawesome-free": "npm:^6.1.2"
"@playwright/test": "npm:1.35.1"
Expand Down Expand Up @@ -1593,7 +1593,7 @@ __metadata:
stylelint-config-twbs-bootstrap: "npm:^14.0.0"
ts-node: "npm:^10.9.2"
typescript: "npm:^5.4.2"
checksum: 10c0/c445671fe4cf0aeaa0211b1fcf538941e30cae6bcc6848600b361404a2af9cc41b6442e62cd401628d525b121f01dc9e62d85e0deb2c7b4e325a48b40a102af8
checksum: 10c0/3e3e344860c6c3d55477525f63703826affb22359af4866deaf7292578d8c4ad398233031c63bb126094425e0d90e5481f58d78cb6abf3a5f0ce3923b924090c
languageName: node
linkType: hard

Expand Down Expand Up @@ -2048,7 +2048,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "docs@workspace:."
dependencies:
choco-theme: "npm:0.6.0"
choco-theme: "npm:0.7.0"
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 41e8f65

Please sign in to comment.