Skip to content

Commit

Permalink
merge readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stadub committed Sep 9, 2019
2 parents 246a229 + 3ecfd23 commit 88ea1aa
Show file tree
Hide file tree
Showing 21 changed files with 817 additions and 516 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ script:
- sudo pwsh -C 'Install-Module Pester -Force'
# updated help is needed for tests, run as a Job to avoid Write-Progress output
- sudo pwsh -C '(update-help &) | Wait-Job'
- pwsh -C 'Import-Module Pester;cd .\Bookmarks\; Invoke-Pester -EnableExit;'
- pwsh -C 'Import-Module Pester;cd .\Bookmarks\; Invoke-Pester -EnableExit;'
- pwsh -C 'Import-Module Pester;cd .\Currency-Conv\; Invoke-Pester -EnableExit;'
9 changes: 9 additions & 0 deletions 7Zip/7zip-Archive.SmokeTests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Import-Module .\7zip-Archive.psm1


ls -Exclude .git | New-ZipFile "scripts"
Test-ZipFileContent .\scripts.7z
Get-ZipFileContent -Archive .\scripts.7z
Remove-ZipFileContent -Archive .\scripts.7z -File "temp.log"
Read-ZipFile -Archive .\scripts.7z
Add-ZipFileContent -Path .\scripts.7z -FileName .\7zip-Archive.psd1
19 changes: 5 additions & 14 deletions 7Zip/7zip-Archive.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.0.2'

ModuleVersion = '1.1.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -111,19 +112,9 @@

# ReleaseNotes of this module
ReleaseNotes = '
First public release.
Supported function:
Read-ZipFile szr
Add-ZipFileContent sza
Remove-ZipFileContent szrm
Test-ZipFileContent szt
Get-ZipFileContent br
Full documentation at the Github: https://github.com/stadub/PowershellScripts/tree/master/7Zip
Changelog:
Update icon.
Remove extra shared functions
Add update checker
Change test environment to StrictMode=Latest
Fix update checker path
Fix unit tests to work with strict mode
Add ci and build scripts
'

} # End of PSData hashtable
Expand Down
2 changes: 1 addition & 1 deletion 7Zip/7zip-Archive.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

. $PSScriptRoot\Functions.ps1

CheckPsGalleryUpdate 7Zip "1.0.2"
szCheckPsGalleryUpdate 7Zip "1.1.0"

_Initalize

Expand Down
1 change: 1 addition & 0 deletions 7Zip/Aliases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Set-Alias sza Add-ZipFileContent -Scope Global
Set-Alias szrm Remove-ZipFileContent -Scope Global
Set-Alias szt Test-ZipFileContent -Scope Global
Set-Alias br Get-ZipFileContent -Scope Global
Set-Alias szc New-ZipFile -Scope Global

25 changes: 12 additions & 13 deletions 7Zip/Functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function _Initalize() {

$script:_binDir = Get-ProfileDir "7zip" "bin"
$script:_binDir = szGet-ProfileDir "7zip" "bin"
Write-Debug "The 7-zip is dir set to $_binDir"
$script:_7zWin = Join-Path $_binDir "7za.exe"
$script:_7zWinDownloadDir='https://www.7-zip.org/a/7za920.zip'
Expand All @@ -22,19 +22,19 @@ function Test-7ZipInstall {
Write-Debug "Trying to locate 7-zip by the path: $script:_7zWin"

if( -not (Test-Path "$script:_7zWin")){
Write-Output '7Zip didn''t found.'
Write-Output '7Zip didn''t downloaded.'
Write-Output 'Now script going to try to download it.'

$file = Get-TempFileName
$file = szGet-TempFileName
Write-Debug "Temp file: ${file}"

Receive-File "7-Zip" $file $_7zWinDownloadDir
szReceive-File "7-Zip" $file $_7zWinDownloadDir
Write-Debug "Extracting to directory ${_binDir}"
if ( -not (Test-Path $_binDir )) {
New-Item -Path $_binDir -ItemType 'Directory'
}

Extract-ZipFile -FileName "$file" -Path "$_binDir"
szExtract-ZipFile -FileName "$file" -Path "$_binDir"
}
$script:_7zPath = $script:_7zWin

Expand All @@ -56,7 +56,7 @@ function AddKeyArg {
$AllArgs = $null,
[string]$Key = $null
)
if( -not (Test-Empty $Key)){
if( -not (szTest-Empty $Key)){
$AllArgs += "-p$Key"
}
return $AllArgs
Expand Down Expand Up @@ -206,7 +206,6 @@ function Remove-ZipFileContent {
[Alias("Path","Name", "Archive", "p")]
[string]$ArchiveName,

[ValidateScript( { Test-Path $_ -pathType leaf })]
[Parameter(Position = 1, Mandatory = $true)]
[Alias("File", "f")]
[string]$FileName,
Expand Down Expand Up @@ -364,7 +363,7 @@ function New-ZipFile {
process {

$FileNames| ForEach-Object{
if( -not (Test-Empty $_) ){
if( -not (szTest-Empty $_) ){
Write-Debug "Adding file ""$_"""
$files += $_
}
Expand Down Expand Up @@ -432,7 +431,7 @@ function New-ZipFile {
}


if( -not (Test-Empty $([string]$SplitSize) )){
if( -not (szTest-Empty $([string]$SplitSize) )){

$factorName="b"
switch ( $SplitSizeFactor )
Expand Down Expand Up @@ -518,7 +517,7 @@ function Test-ZipFileContent {
$AllArgs = @('t', "$ArchiveName")


if( -not (Test-Empty $FileName) ){
if( -not (szTest-Empty $FileName) ){
$AllArgs += "$FileName"
}

Expand Down Expand Up @@ -586,12 +585,12 @@ function Get-ZipFileContent {

$AllArgs = @('e', "$ArchiveName")

if( -not (Test-Empty $FileName) ){
if( -not (szTest-Empty $FileName) ){
$AllArgs += "$FileName"
}

if( -not (Test-Empty $destFolder) ){
CreateFolderIfNotExist "${destFolder}"
if( -not (szTest-Empty $destFolder) ){
szCreateFolderIfNotExist "${destFolder}"
$AllArgs += "-o$destFolder"
}

Expand Down
4 changes: 3 additions & 1 deletion 7Zip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Test-ZipFileContent - Perform zip file check

| Cmdlet | Alias |
| ---------------------|:------:|
| New-ZipFile | szc |
| Read-ZipFile | szr |
| Add-ZipFileContent | sza |
| Remove-ZipFileContent| szrm |
Expand Down Expand Up @@ -179,10 +180,11 @@ Test-ZipFileContent - Perform zip file check

## Changelog

### [v1.1.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.9.5)
### [v1.1.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.9.5) Spet 9, 2019

* Fix Remove-ZipFileContent returns Cannot validate argument on parameter 'FileName'. #14
* Fix 7-zpi szc New-ZipFile alias is absent bug #14
* Add smoke tests

### [v1.0.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.4.0)

Expand Down
Loading

0 comments on commit 88ea1aa

Please sign in to comment.