Skip to content

Commit

Permalink
Support for settings on Linux and macOS (#73)
Browse files Browse the repository at this point in the history
* Support for settings on Linux and macOS

* Easton's suggestion

* Update YamlCreate.md

* Update Tools/YamlCreate.ps1

Co-authored-by: Kaleb Luedtke <[email protected]>

* Update YamlCreate.ps1

Co-authored-by: Kaleb Luedtke <[email protected]>
  • Loading branch information
vedantmgoyal9 and Trenly authored Oct 5, 2021
1 parent cbf1f38 commit 77b35e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Tools/YamlCreate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ if ($help) {
exit
}

# Set settings directory on basis of Operating System
$script:SettingsPath = Join-Path $(if ([System.Environment]::OSVersion.Platform -match 'Win') {$env:LOCALAPPDATA} else {$env:HOME+'/.config'} ) -ChildPath 'YamlCreate'
# Check for settings directory and create it if none exists
$script:SettingsPath = Join-Path $env:LOCALAPPDATA -ChildPath 'YamlCreate'
if (!(Test-Path $script:SettingsPath)) { New-Item -ItemType 'Directory' -Force -Path $script:SettingsPath | Out-Null }
# Check for settings file and create it if none exists
$script:SettingsPath = $(Join-Path $script:SettingsPath -ChildPath 'Settings.yaml')
Expand Down
4 changes: 2 additions & 2 deletions doc/tools/YamlCreate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Using YamlCreate.ps1
Using the YamlCreate is easy. First, [create a fork](https://docs.github.com/get-started/quickstart/fork-a-repo) of this repository and then [clone it](https://docs.github.com/repositories/creating-and-managing-repositories/cloning-a-repository) to your computer. Once the repository has finished cloning, open file explorer and navigate to the folder that the repository was cloned into. Inside this folder, you should be able to navigate to the `Tools` folder, which contains the script. Right click on "YamlCreate" and select "Run with PowerShell". If it is your first time running the script, you may see a message that it is installing some additional packages - [NuGet](https://docs.microsoft.com/nuget/), and [powershell-yaml] (https://www.powershellgallery.com/packages/powershell-yaml/0.4.2)([See it on GitHub](https://github.com/cloudbase/powershell-yaml)). These are required for the script to run.
Using the YamlCreate is easy. First, [create a fork](https://docs.github.com/get-started/quickstart/fork-a-repo) of this repository and then [clone it](https://docs.github.com/repositories/creating-and-managing-repositories/cloning-a-repository) to your computer. Once the repository has finished cloning, open file explorer and navigate to the folder that the repository was cloned into. Inside this folder, you should be able to navigate to the `Tools` folder, which contains the script. Right click on "YamlCreate" and select "Run with PowerShell". If it is your first time running the script, you may see a message that it is installing some additional packages - [NuGet](https://docs.microsoft.com/nuget/), and [powershell-yaml](https://www.powershellgallery.com/packages/powershell-yaml/0.4.2) ([See it on GitHub](https://github.com/cloudbase/powershell-yaml)). These are required for the script to run.

Once the script begins, it will walk you through a series of prompts to create manifests. Enter the requested information for each of the prompts and once all the prompts are completed, the manifest will be generated! If you have Windows Sandbox enabled and the GitHub CLI installed, you can even automatically test and submit your manifest instead of having to do it manually.

Expand All @@ -22,7 +22,7 @@ When running YamlCreate through the command line, you can specify additional arg
`.\YamlCreate.ps1 [-PackageIdentifier <identifier>] [-PackageVersion <version>] [-Mode <1-5>] [-Settings]`

# YamlCreate Settings
YamlCreate offers a few settings to customize your manifest creation experience. The settings file is found in the `%LOCALAPPDATA%\YamlCreate` folder. It is empty by default, but you can copy the sample below which describes what all of the available options are; or, you can enter just specific keys as you see fit.
YamlCreate offers a few settings to customize your manifest creation experience. The settings file is found in the `%LOCALAPPDATA%\YamlCreate` folder on Windows and `/home/<username>/.config/YamlCreate` on Linux and macOS. It is empty by default, but you can copy the sample below which describes what all of the available options are; or, you can enter just specific keys as you see fit.
```yaml
# This setting allows you to set a default action for whether or not to test your manifest in windows sandbox
# always - Always tests manifests
Expand Down

0 comments on commit 77b35e1

Please sign in to comment.