Skip to content

Commit 51cf2c5

Browse files
(MAINT) Fix and update tstoy install info
Prior to this change, the install instructions for TSToy pointed to a fictional URL. This change: 1. Moves the tstoy source from the `app` folder to `tstoy`, so that using `go install` pulls the application with the correct name. There is no way to set a canonical name for the executable when installed this way except by folder name. 1. Updates the build script for the `package` action to build and archive the application for every supported OS and add them to the `tstoy/latest` folder. This is a temporary work around until we can get a more canonical solution for "releasing" the fictional app on Github. 1. Updates the install instructions to enable users to select either option. 1. Makes minor improvements to the display for the TSToy about page.
1 parent c9871c0 commit 51cf2c5

26 files changed

+109
-26
lines changed

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* text eol=lf
2-
*.png binary
3-
*.gif binary
2+
*.png binary
3+
*.gif binary
4+
*.zip binary
5+
*.tar.gz binary

.site/assets/styles/_custom.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sl-tab-group.shell-completion {
2+
sl-tab {
3+
&::part(base) {
4+
padding-top: 0.5rem;
5+
padding-bottom: 0.5rem;
6+
}
7+
}
8+
}

docs/tstoy/about.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,29 @@ manage the configuration files.
1515

1616
## Installing TSToy
1717

18-
[Download the latest release][01] for your operating system. After you download the release
19-
archive, you need to expand the archive and add it to your PATH. You'll need the application while
20-
following any of the tutorials in this section.
18+
```````````tabs
19+
---
20+
id: install-instructions
21+
placement: start
22+
---
23+
``````tab { name="From Archive" }
24+
[Download the latest release][t1] for your operating system. After you download
25+
the release archive, you need to expand the archive and add it to your `PATH`.
26+
You'll need the application while following any of the tutorials in this
27+
section.
28+
29+
[t1]: https://github.com/PowerShell/DSC-Samples/tree/main/tstoy/latest
30+
``````
31+
32+
``````tab { name="With Go" }
33+
If you have Go installed on your system, you can use `go install` to get the
34+
latest version of the application and install it to your `GOPATH`.
35+
36+
```sh
37+
go install github.com/PowerShell/DSC-Samples/tstoy@latest
38+
```
39+
``````
40+
```````````
2141

2242
<!-- Add tabbed examples for doing so -->
2343

@@ -30,29 +50,44 @@ tstoy
3050

3151
You can enable shell completions for the application to make interacting with it easier.
3252

53+
```````````tabs
54+
---
55+
id: enable-shell-completions
56+
placement: start
57+
class: shell-completion
58+
---
59+
``````tab { name="Bash" }
3360
```bash
3461
# bash
3562
tstoy completion bash --help
3663
source <(tstoy completion bash)
3764
```
65+
``````
3866
39-
```sh
67+
``````tab { name="fish" }
68+
```fish
4069
# fish
4170
tstoy completion fish --help
4271
tstoy completion fish | source
4372
```
73+
``````
4474
75+
``````tab { name="PowerShell" }
4576
```powershell
4677
# PowerShell
4778
tstoy completion powershell --help
4879
tstoy completion powershell | Out-String | Invoke-Expression
4980
```
81+
``````
5082
83+
``````tab { name="ZSH" }
5184
```zsh
5285
# zsh
5386
tstoy completion zsh --help
5487
source <(tstoy completion zsh)
5588
```
89+
``````
90+
```````````
5691

5792
## TSToy configuration
5893

@@ -106,7 +141,10 @@ tstoy show path machine
106141
tstoy show path user
107142
```
108143

109-
``````tabs { #command-output}
144+
``````tabs
145+
---
146+
id: command-output
147+
---
110148
````tab { name="On Windows" }
111149
```powershell
112150
tstoy show path
@@ -188,6 +226,3 @@ tstoy show --only machine,user
188226
Machine configuration: {}
189227
User configuration: {}
190228
```
191-
192-
<!-- Fictional URL -->
193-
[01]: https://github.com/MicrosoftDocs/DSC-Examples/releases/tag/app%2Fv1.0.0

go.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
go 1.19
22

33
use (
4-
./app
4+
./tstoy
55
./samples/go/resources/first
66
)

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
base = ".site/"
33
publish = "public"
44
command = "../netlify.sh"
5-
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./docs ./samples ./app"
5+
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./docs ./samples ./tstoy"
66

77
[context.production.environment]
88
HUGO_VERSION = "0.116.1"
File renamed without changes.

app/.goreleaser.yaml renamed to tstoy/.goreleaser.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ builds:
1616
- darwin
1717
ldflags:
1818
- -s -w
19-
- -X github.com/PowerShell/DSC-Samples/app/cmd.version={{.Version}}
20-
- -X github.com/PowerShell/DSC-Samples/app/cmd.commit={{.ShortCommit}}
21-
- -X github.com/PowerShell/DSC-Samples/app/cmd.date={{.CommitDate}}
19+
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.version={{.Version}}
20+
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.commit={{.ShortCommit}}
21+
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.date={{.CommitDate}}
2222

2323
archives:
2424
- format: tar.gz
@@ -44,7 +44,6 @@ changelog:
4444
exclude:
4545
- '^docs:'
4646
- '^test:'
47-
4847
# The lines beneath this are called `modelines`. See `:help modeline`
4948
# Feel free to remove those if you don't want/use them.
5049
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
File renamed without changes.
File renamed without changes.

app/build.ps1 renamed to tstoy/build.ps1

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,43 @@ function Build-Project {
1616
param(
1717
[switch]$All
1818
)
19-
if ($All) {
20-
goreleaser release --skip-publish --skip-announce --skip-validate --clean --release-notes ./RELEASE_NOTES.md
21-
} else {
22-
goreleaser build --snapshot --clean --single-target
19+
20+
begin {
21+
[string[]]$Arguments = @(
22+
'--clean'
23+
'--snapshot'
24+
)
25+
$DistFolder = "$PSScriptRoot/dist"
26+
$LatestFolder = "$PSScriptRoot/latest"
2327
}
24-
Get-Command "./dist/tstoy*/tstoy*" -ErrorAction Stop
28+
process {
29+
if ($All) {
30+
$Arguments += @(
31+
'--skip-publish'
32+
'--skip-announce'
33+
'--skip-validate'
34+
)
35+
goreleaser release @Arguments
36+
37+
if (Test-Path $LatestFolder) {
38+
Remove-Item -Path $LatestFolder/* -Force -Recurse
39+
} else {
40+
mkdir $LatestFolder
41+
}
42+
43+
Get-ChildItem -Path $DistFolder -File
44+
| Where-Object -FilterScript { $_.Name -match '\.(txt|tar\.gz|zip)'}
45+
| Move-Item -Destination $LatestFolder
46+
} else {
47+
$Arguments += @(
48+
'--single-target'
49+
)
50+
goreleaser build @Arguments
51+
Get-Command "./dist/tstoy*/tstoy*" -ErrorAction Stop
52+
}
53+
}
54+
55+
end { }
2556
}
2657

2758
switch ($Target) {

0 commit comments

Comments
 (0)