Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* text eol=lf
*.png binary
*.gif binary
*.png binary
*.gif binary
*.zip binary
*.tar.gz binary
8 changes: 8 additions & 0 deletions .site/assets/styles/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sl-tab-group.shell-completion {
sl-tab {
&::part(base) {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
}
}
51 changes: 43 additions & 8 deletions docs/tstoy/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,29 @@ manage the configuration files.

## Installing TSToy

[Download the latest release][01] for your operating system. After you download the release
archive, you need to expand the archive and add it to your PATH. You'll need the application while
following any of the tutorials in this section.
```````````tabs
---
id: install-instructions
placement: start
---
``````tab { name="From Archive" }
[Download the latest release][t1] for your operating system. After you download
the release archive, you need to expand the archive and add it to your `PATH`.
You'll need the application while following any of the tutorials in this
section.

[t1]: https://github.com/PowerShell/DSC-Samples/tree/main/tstoy/latest
``````

``````tab { name="With Go" }
If you have Go installed on your system, you can use `go install` to get the
latest version of the application and install it to your `GOPATH`.

```sh
go install github.com/PowerShell/DSC-Samples/tstoy@latest
```
``````
```````````

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

Expand All @@ -30,29 +50,44 @@ tstoy

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

```````````tabs
---
id: enable-shell-completions
placement: start
class: shell-completion
---
``````tab { name="Bash" }
```bash
# bash
tstoy completion bash --help
source <(tstoy completion bash)
```
``````

```sh
``````tab { name="fish" }
```fish
# fish
tstoy completion fish --help
tstoy completion fish | source
```
``````

``````tab { name="PowerShell" }
```powershell
# PowerShell
tstoy completion powershell --help
tstoy completion powershell | Out-String | Invoke-Expression
```
``````

``````tab { name="ZSH" }
```zsh
# zsh
tstoy completion zsh --help
source <(tstoy completion zsh)
```
``````
```````````

## TSToy configuration

Expand Down Expand Up @@ -106,7 +141,10 @@ tstoy show path machine
tstoy show path user
```

``````tabs { #command-output}
``````tabs
---
id: command-output
---
````tab { name="On Windows" }
```powershell
tstoy show path
Expand Down Expand Up @@ -188,6 +226,3 @@ tstoy show --only machine,user
Machine configuration: {}
User configuration: {}
```

<!-- Fictional URL -->
[01]: https://github.com/MicrosoftDocs/DSC-Examples/releases/tag/app%2Fv1.0.0
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go 1.19

use (
./app
./tstoy
./samples/go/resources/first
)
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
base = ".site/"
publish = "public"
command = "../netlify.sh"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./docs ./samples ./app"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./docs ./samples ./tstoy"

[context.production.environment]
HUGO_VERSION = "0.116.1"
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions app/.goreleaser.yaml → tstoy/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ builds:
- darwin
ldflags:
- -s -w
- -X github.com/PowerShell/DSC-Samples/app/cmd.version={{.Version}}
- -X github.com/PowerShell/DSC-Samples/app/cmd.commit={{.ShortCommit}}
- -X github.com/PowerShell/DSC-Samples/app/cmd.date={{.CommitDate}}
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.version={{.Version}}
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.commit={{.ShortCommit}}
- -X github.com/PowerShell/DSC-Samples/tstoy/cmd.date={{.CommitDate}}

archives:
- format: tar.gz
Expand All @@ -44,7 +44,6 @@ changelog:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
Expand Down
File renamed without changes.
File renamed without changes.
41 changes: 36 additions & 5 deletions app/build.ps1 → tstoy/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,43 @@ function Build-Project {
param(
[switch]$All
)
if ($All) {
goreleaser release --skip-publish --skip-announce --skip-validate --clean --release-notes ./RELEASE_NOTES.md
} else {
goreleaser build --snapshot --clean --single-target

begin {
[string[]]$Arguments = @(
'--clean'
'--snapshot'
)
$DistFolder = "$PSScriptRoot/dist"
$LatestFolder = "$PSScriptRoot/latest"
}
Get-Command "./dist/tstoy*/tstoy*" -ErrorAction Stop
process {
if ($All) {
$Arguments += @(
'--skip-publish'
'--skip-announce'
'--skip-validate'
)
goreleaser release @Arguments

if (Test-Path $LatestFolder) {
Remove-Item -Path $LatestFolder/* -Force -Recurse
} else {
mkdir $LatestFolder
}

Get-ChildItem -Path $DistFolder -File
| Where-Object -FilterScript { $_.Name -match '\.(txt|tar\.gz|zip)'}
| Move-Item -Destination $LatestFolder
} else {
$Arguments += @(
'--single-target'
)
goreleaser build @Arguments
Get-Command "./dist/tstoy*/tstoy*" -ErrorAction Stop
}
}

end { }
}

switch ($Target) {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/path.go → tstoy/cmd/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"path/filepath"

"github.com/PowerShell/DSC-Samples/app/config"
"github.com/PowerShell/DSC-Samples/tstoy/config"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion app/cmd/root.go → tstoy/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"os"

"github.com/PowerShell/DSC-Samples/app/config"
"github.com/PowerShell/DSC-Samples/tstoy/config"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/show.go → tstoy/cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package cmd
import (
"fmt"

"github.com/PowerShell/DSC-Samples/app/config"
"github.com/PowerShell/DSC-Samples/tstoy/config"
"github.com/TylerBrock/colorjson"
"github.com/charmbracelet/lipgloss"
"github.com/spf13/cobra"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/go.mod → tstoy/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/PowerShell/DSC-Samples/app
module github.com/PowerShell/DSC-Samples/tstoy

go 1.19

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions tstoy/latest/checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
190aa096ce157cacc0215536e4ea2d17d2940a169c79f51b771f94d2673a1a50 tstoy_Darwin_arm64.tar.gz
4060f3d6a8279ee44484b987102bc4032f48b7c44a0e90d74c30972ee9a0a894 tstoy_Linux_x86_64.tar.gz
45178000d04a859ebe01711626d0e05130891888cdbaaebf1c3c5adb09b6c94d tstoy_Windows_arm64.zip
473d19ca3e870883f3a50bbf85a907b31d030de168092da3891ae9b3e6d38d07 tstoy_Darwin_x86_64.tar.gz
488920330f8a03a691b107d4cad0e6df5a3818cf7f5d7f86d4fee219e4d1c647 tstoy_Linux_i386.tar.gz
994347b4f5255e444fdd5c8e3dcf32668974e321b299fdb98eeff582d4a76a2e tstoy_Windows_x86_64.zip
af7c861addf2dbde483b8c6aba7e3a62478b1968b4fad3306a30c5ce63121f06 tstoy_Linux_arm64.tar.gz
d7fe51f0668bf541a28102cdfc804696096739fb055a7228b8dbae2681c02c7e tstoy_Windows_i386.zip
Binary file added tstoy/latest/tstoy_Darwin_arm64.tar.gz
Binary file not shown.
Binary file added tstoy/latest/tstoy_Darwin_x86_64.tar.gz
Binary file not shown.
Binary file added tstoy/latest/tstoy_Linux_arm64.tar.gz
Binary file not shown.
Binary file added tstoy/latest/tstoy_Linux_i386.tar.gz
Binary file not shown.
Binary file added tstoy/latest/tstoy_Linux_x86_64.tar.gz
Binary file not shown.
Binary file added tstoy/latest/tstoy_Windows_arm64.zip
Binary file not shown.
Binary file added tstoy/latest/tstoy_Windows_i386.zip
Binary file not shown.
Binary file added tstoy/latest/tstoy_Windows_x86_64.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion app/main.go → tstoy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package main

import "github.com/PowerShell/DSC-Samples/app/cmd"
import "github.com/PowerShell/DSC-Samples/tstoy/cmd"

func main() {
cmd.Execute()
Expand Down