Skip to content

Commit

Permalink
Merge branch 'main' into docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
og-mrk authored Sep 29, 2024
2 parents 4af694d + 225e774 commit 1480156
Show file tree
Hide file tree
Showing 52 changed files with 1,962 additions and 1,127 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
labels: 'enhancement'
assignees: ''

---
Expand Down
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Pull Request

<!--Before you make this PR have you followed the docs here? - https://christitustech.github.io/winutil/contribute/ -->

## Title
<!--[Provide a succinct and descriptive title for the pull request.]-->

## Type of Change
- [ ] New feature
- [ ] Bug fix
Expand Down
10 changes: 3 additions & 7 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
tag-prefix: ""
tag-prefix: ''
categories:
- title: '🚀 Features'
labels:
Expand All @@ -21,10 +19,6 @@ template: |
$CHANGES
## Contributors
$CONTRIBUTORS
change-title-escapes: '\<*_&"'''
autolabeler:
- label: 'documentation'
Expand Down Expand Up @@ -56,3 +50,5 @@ replacers:
replace: ''
exclude-labels:
- 'skip-changelog'

filter-by-commitish: true
42 changes: 35 additions & 7 deletions .github/workflows/close-issue-command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,33 @@ jobs:
contents: read

steps:
- name: Check for /close comment
id: check_comment
- run: echo "command=false" >> $GITHUB_ENV

- name: Check for /close command
id: check_close_command
run: |
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
echo "comment=true" >> $GITHUB_ENV
echo "command=true" >> $GITHUB_ENV
echo "close_command=true" >> $GITHUB_ENV
echo "reopen_command=false" >> $GITHUB_ENV
else
echo "close_command=false" >> $GITHUB_ENV
fi
- name: Check for /open or /reopen command
id: check_reopen_command
run: |
if [[ "${{ contains(github.event.comment.body, '/open') }}" == "true" ]] || [[ "${{ contains(github.event.comment.body, '/reopen') }}" == "true" ]]; then
echo "command=true" >> $GITHUB_ENV
echo "reopen_command=true" >> $GITHUB_ENV
echo "close_command=false" >> $GITHUB_ENV
else
echo "comment=false" >> $GITHUB_ENV
echo "reopen_command=false" >> $GITHUB_ENV
fi
- name: Check if the user is allowed
id: check_user
if: env.comment == 'true'
if: env.command == 'true'
run: |
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC")
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
Expand All @@ -36,10 +51,23 @@ jobs:
fi
- name: Close issue if conditions are met
if: env.comment == 'true' && env.user == 'true'
if: env.close_command == 'true' && env.user == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
echo Closing the issue...
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
if [[ "${{ contains(github.event.comment.body, 'not planned') }}" == "true" ]]; then
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} --reason 'not planned'
else
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
fi
- name: Reopen issue if conditions are met
if: env.reopen_command == 'true' && env.user == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
echo Reopening the issue...
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}
10 changes: 5 additions & 5 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ jobs:

- name: Generate Release Notes
id: generate_notes
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-drafter.yml
version: ${{ env.version }}
version: ${{ env.VERSION }} # Pass the version variable

- name: Create and Upload Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.version }}
name: Pre-Release ${{ env.version }}
tag_name: ${{ env.VERSION }}
name: Pre-Release ${{ env.VERSION }}
body: |
${{ steps.generate_notes.outputs.body }}
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ env.VERSION }}/winutil.ps1)
append_body: false
files: ./winutil.ps1
Expand Down
48 changes: 31 additions & 17 deletions Compile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ param (
[switch]$SkipPreprocessing,
[string]$Arguments
)

if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) {
Remove-Item ".\winutil.ps1" -Force
}

$OFS = "`r`n"
$scriptname = "winutil.ps1"
$workingdir = $PSScriptRoot

Push-Location
Set-Location $workingdir

# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $workingdir
Expand Down Expand Up @@ -42,11 +50,11 @@ if (-NOT $SkipPreprocessing) {

# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
. "$(($workingdir -replace ('\\$', '')) + '\' + ($preprocessingFilePath -replace ('\.\\', '')))"
. $preprocessingFilePath

$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
$msg = "Pre-req: Code Formatting"
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg -ThrowExceptionOnEmptyFilesList
}

# Create the script in memory.
Expand All @@ -57,14 +65,14 @@ Update-Progress "Adding: Header" 5
$script_content.Add($header)

Update-Progress "Adding: Version" 10
$script_content.Add($(Get-Content "$workingdir\scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
$script_content.Add($(Get-Content "scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))

Update-Progress "Adding: Functions" 20
Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
Get-ChildItem "functions" -Recurse -File | ForEach-Object {
$script_content.Add($(Get-Content $psitem.FullName))
}
Update-Progress "Adding: Config *.json" 40
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
Get-ChildItem "config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
$json = (Get-Content $psitem.FullName).replace("'","''")
$jsonAsObject = $json | convertfrom-json

Expand All @@ -85,34 +93,39 @@ Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
}

$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")
# Read the entire XAML file as a single string, preserving line breaks
$xaml = Get-Content "$workingdir\xaml\inputXML.xaml" -Raw

Update-Progress "Adding: Xaml " 90

$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
# Add the XAML content to $script_content using a here-string
$script_content.Add(@"
`$inputXML = @'
$xaml
'@
"@)

$script_content.Add($(Get-Content "$workingdir\scripts\main.ps1"))
$script_content.Add($(Get-Content "scripts\main.ps1"))

if ($Debug) {
Update-Progress "Writing debug files" 95
$appXamlContent | Out-File -FilePath "$workingdir\xaml\inputApp.xaml" -Encoding ascii
$tweaksXamlContent | Out-File -FilePath "$workingdir\xaml\inputTweaks.xaml" -Encoding ascii
$featuresXamlContent | Out-File -FilePath "$workingdir\xaml\inputFeatures.xaml" -Encoding ascii
$appXamlContent | Out-File -FilePath "xaml\inputApp.xaml" -Encoding ascii
$tweaksXamlContent | Out-File -FilePath "xaml\inputTweaks.xaml" -Encoding ascii
$featuresXamlContent | Out-File -FilePath "xaml\inputFeatures.xaml" -Encoding ascii
} else {
Update-Progress "Removing temporary files" 99
Remove-Item "$workingdir\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
Remove-Item "$workingdir\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
Remove-Item "$workingdir\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
Remove-Item "xaml\inputApp.xaml" -ErrorAction SilentlyContinue
Remove-Item "xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
Remove-Item "xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
}

Set-Content -Path "$workingdir\$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
Set-Content -Path "$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
Write-Progress -Activity "Compiling" -Completed

Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
try {
$null = Get-Command -Syntax .\winutil.ps1
}
catch {
} catch {
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
Write-Host "$($Error[0])" -ForegroundColor Red
}
Expand All @@ -128,3 +141,4 @@ if ($run) {

break
}
Pop-Location
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win

These are the sponsors that help keep this project alive with monthly contributions.

<!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https://github.com/ysaito8015.png" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="" /></a><a href="https://github.com/JennJones89"><img src="https://github.com/JennJones89.png" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https://github.com/thaddl.png" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/woobe-studio"><img src="https://github.com/woobe-studio.png" width="60px" alt="Michael Wozniak" /></a><a href="https://github.com/xBandaku"><img src="https://github.com/xBandaku.png" width="60px" alt="xPandaku" /></a><a href="https://github.com/claudemods"><img src="https://github.com/claudemods.png" width="60px" alt="Claudemods" /></a><a href="https://github.com/hkolatan"><img src="https://github.com/hkolatan.png" width="60px" alt="Halil Kolatan" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="" /></a><a href="https://github.com/tcookj66"><img src="https://github.com/tcookj66.png" width="60px" alt="Timothy Cook" /></a><a href="https://github.com/june349"><img src="https://github.com/june349.png" width="60px" alt="" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;3502978?u&#x3D;ca98bf67f04d67080df0feeaa6f007fad51d273f&amp;v&#x3D;4" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;39857764?u&#x3D;5dbda638f45530582eee1703b4473f2a5e229e28&amp;v&#x3D;4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;3272468?u&#x3D;4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;127976398?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;9561861?u&#x3D;3cca179dcff0413538591e57a3abea116d65ce56&amp;v&#x3D;4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;54533224?u&#x3D;a49ea000a8f52adb31382ea69a1a7501b27fefdd&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;58894405?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;18660571?u&#x3D;601d0a23040a271c86b5d40339f899a6dbf27086&amp;v&#x3D;4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;105566568?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;65176625?v&#x3D;4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;105917451?u&#x3D;ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;12015331?v&#x3D;4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;71956566?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;31177857?u&#x3D;efdbae734a4c60a7bb95df4659d0535e60a6fd57&amp;v&#x3D;4" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;70013104?u&#x3D;116d35b3119744c568c39669475439427a564e49&amp;v&#x3D;4" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;45240946?u&#x3D;d4db66f8e8d7a2606fe7a5521daf48ca9f097105&amp;v&#x3D;4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;4107092?v&#x3D;4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;19240897?u&#x3D;f82b4be098cac65c8421421b70ebd2d1da85c67e&amp;v&#x3D;4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/xBandaku"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;142067112?u&#x3D;0c9a1edee45ac2a0a42827d418a12b1791d52350&amp;v&#x3D;4" width="60px" alt="xPandaku" /></a><a href="https://github.com/claudemods"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;73653396?u&#x3D;d64c656fb8db24ef56bb000197532df9b618d06c&amp;v&#x3D;4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;173957728?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/tcookj66"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;61920813?v&#x3D;4" width="60px" alt="Timothy Cook" /></a><a href="https://github.com/june349"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;176018493?u&#x3D;59825046a74741d102d0e03ab1b7122b27cd2c3e&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/issacs-tech"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;180139285?u&#x3D;b57d597a599c549b7527874b7a65304de119657e&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;140165544?v&#x3D;4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/defiling9046"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;180418747?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/samithseu"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;59063392?u&#x3D;2b361f4f7547498c8aefa313cb903ea058ca8f45&amp;v&#x3D;4" width="60px" alt="MITH ツ" /></a><!-- sponsors -->

## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
Expand Down
2 changes: 1 addition & 1 deletion config/applications.json
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@
"content": "Google Drive",
"description": "File syncing across devices all tied to your google account",
"link": "https://www.google.com/drive/",
"winget": "Google.Drive"
"winget": "Google.GoogleDrive"
},
"gpuz": {
"category": "Utilities",
Expand Down
2 changes: 1 addition & 1 deletion config/autounattend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
<ExtractScript>
param(
[xml] $Document
[xml]$Document
);

$scriptsDir = 'C:\Windows\Setup\Scripts\';
Expand Down
16 changes: 16 additions & 0 deletions config/feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@
"ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/sound"
},
"WPFPanelprinter": {
"Content": "Printer Panel",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/printer"
},
"WPFPanelsystem": {
"Content": "System Properties",
"category": "Legacy Windows Panels",
Expand All @@ -297,5 +305,13 @@
"Type": "Button",
"ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user"
},
"WPFWinUtilPSProfile": {
"Content": "Install CTT PowerShell Profile",
"category": "Powershell Profile",
"panel": "2",
"Order": "a083_",
"Type": "Button",
"ButtonWidth": "300"
}
}
Loading

0 comments on commit 1480156

Please sign in to comment.