Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ni/labview-git-diff-scripts
Scripts for generating diffs of LabVIEW files
https://github.com/ni/labview-git-diff-scripts
Last synced: 3 months ago
JSON representation
Scripts for generating diffs of LabVIEW files
- Host: GitHub
- URL: https://github.com/ni/labview-git-diff-scripts
- Owner: ni
- License: mit
- Created: 2021-03-23T20:36:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-06T04:28:24.000Z (over 3 years ago)
- Last Synced: 2024-05-28T15:22:07.299Z (6 months ago)
- Language: PowerShell
- Size: 212 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-labview - LabView Git Diff Scripts - Powershell cmdlets to compute diffs of VIs. (DevOps / Version Control / CI / CD)
README
# LabVIEW Git Diff Scripts
PowerShell cmdlets to generate diffs of LabVIEW files residing in a git repository.
![GitHub](https://img.shields.io/github/license/ni/labview-git-diff-scripts)
## Installing
```pwsh
# Clone this repository
PS> git clone 'https://github.com/ni/labview-git-diff-scripts.git'
```## Getting Started
```pwsh
# Import the main module
PS> cd 'labview-git-diff-scripts'
PS> Import-Module .\NI.LvDiff\NI.LvDiff.psm1 -Force
```## Usage
- Output an object per changed LabVIEW file that contains its path and connector pane, front panel, and block diagram `[NI.ImageDiff]`:
```pwsh
> Start-LvDiff -RepositoryPath
> Compare-LvFiles -NewCommit HEAD -BaseCommit mainPath ImageDiffs
---- ----------
C:\repo\path\File1.vi {JFoOfu_File1_connector, JFoOfu_File1_frontpanel_Resized,JFoOfu_File1_blockdiagram}
C:\repo\path\File2.vi {3v3qjk_File2_connector, 3v3qjk_File2_frontpanel,3v3qjk_File2_blockdiagram}
```- Output a merged before/after image (containing connector pane, front panel, and block diagram) per changed LabVIEW file:
```pwsh
> Start-LvDiff -RepositoryPath
> Compare-LvFiles -NewCommit HEAD -BaseCommit main | ForEach-Object { $_.ImageDiffs | Merge-ImageDiffs }C:\users\\AppData\Local\Temp\tmpB202\Before.png
C:\users\\AppData\Local\Temp\tmpB202\After.png
C:\users\\AppData\Local\Temp\tmpD192\Before.png
C:\users\\AppData\Local\Temp\tmpD192\After.png
```Or, using the same output directory for all files:
```pwsh
> Start-LvDiff -RepositoryPath
> $outputPath = New-TemporaryPath
> Compare-LvFiles -OutputPath $outputPath -NewCommit HEAD -BaseCommit main |
ForEach-Object { $i = 0 } {
$i += 1
Merge-ImageDiffs `
-OutputPath $outputPath `
-BeforeName "Before$i" `
-AfterName "After$i" `
-ImageDiffs $_.ImageDiffs[$i]
}
```If `Start-LvDiff` is to be used multiple times in the same PowerShell session, `Stop-LvDiff` should be called before calling `Start-LvDiff` with a different repository e.g.:
```pwsh
try {
Start-LvDiff -RepositoryPath
...
} finally {
Stop-LvDiff
}
```## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
## License
LabVIEW Git Diff Scripts is released under the [MIT License](LICENSE.md)