Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
add the new version v5.3.3, and move clone command to folder, update …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
abdfnx committed Apr 12, 2021
1 parent 03864e9 commit 8bbba1c
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 54 deletions.
35 changes: 28 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,41 @@
---

## [[v5.3.3] 2021-04-12](#v532-2021-04-12)

### Added

- Create imgs website **https://imgs-secman.web.app**, creator: @abdfnx
- Add [version-checker](https://github.com/secman-team/version-checker) package, creator: @abdfnx

### Changed

- Make version is main, ver is an alias
- Make clone is main, cn and / are aliases
- Change clone message, now it's shows the private repo at **https://github.com/:USERNAME/.secman**
- Add usage message in secman-sync
- Also Add usage message in cgit
- Clean up _cgit_ and _verx_
- Move sm folder location from **/home** to **~**

### Fixed

- Fix upgrade command

## [[v5.3.2] 2021-04-03](#v532-2021-04-03)

### Added

- Create / command (cn), creator [@iMRxM7mD](https://github.com/iMRxM7mD)
- Configure upgrade command for windows, creator [@abdfnx](https://github.com/abdfnx)
- Create deps website **https://secman-team.github.io**, creator: [@Timothee](https://github.com/Timothee-Cardoso)
- Create uninstall command, creator: [@abdfnx](https://github.com/abdfnx)
- When install secman in windows, now it's creates env path variable, creator: [@abdfnx](https://github.com/abdfnx)
- Add special build for scoop, creator: [@abdfnx](https://github.com/abdfnx)
- Create / command (cn), creator @iMRxM7mD
- Configure upgrade command for windows, creator @abdfnx
- Create deps website **https://secman-team.github.io**, creator: @Timothee
- Create uninstall command, creator: @abdfnx
- When install secman in windows, now it's creates env path variable, creator: @abdfnx
- Add special build for scoop, creator: @abdfnx

### Changed

- Make upgrade is main, upg is alias
- Make upgrade is main, upg is an alias
- Now secman-un is not a subprogram, it's in sm folder
- When there's a new release, the message was changed
- Improve CircelCI Actions in secman
Expand Down
54 changes: 54 additions & 0 deletions clone/clone.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package clone

import (
"fmt"
"log"
"strings"
"runtime"
"github.com/secman-team/shell"
)

func Core() {
if runtime.GOOS == "windows"{
shell.PWSLCmd("& $HOME/sm/secman-sync.ps1 cn")
shell.PWSLCmd(
`
if (Test-Path -path $HOME/.secman) {
Write-Host "cloned successfully"
}
`,
)
} else {
shell.ShellCmd("secman-sync cn")
shell.ShellCmd(`if [ -d ~/.secman ]; then echo "cloned successfully ✅"; fi`)
}
}

func Help() string {
const msg string = "Clone your .secman from your private repo at https://github.com/"
repo := "/.secman ."

if runtime.GOOS == "windows" {
err, username, errout := shell.PWSLOut("git config user.name")

uname := strings.TrimSuffix(username, "\n")

if err != nil {
log.Printf("error: %v\n", err)
fmt.Print(errout)
}

return msg + uname + repo
} else {
err, username, errout := shell.ShellOut("git config user.name")

uname := strings.TrimSuffix(username, "\n")

if err != nil {
log.Printf("error: %v\n", err)
fmt.Print(errout)
}

return msg + uname + repo
}
}
50 changes: 4 additions & 46 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"log"
"runtime"
"strconv"
"strings"

"github.com/secman-team/shell"
checker "github.com/secman-team/version-checker"

"github.com/secman-team/secman/api/sync"
"github.com/secman-team/secman/clean"
"github.com/secman-team/secman/clone"
"github.com/secman-team/secman/edit"
"github.com/secman-team/secman/fetch"
"github.com/secman-team/secman/gen"
Expand All @@ -23,35 +23,6 @@ import (
"github.com/spf13/cobra"
)

func cloneHELP() string {
const msg string = "Clone your .secman from your private repo at https://github.com/"
repo := "/.secman ."

if runtime.GOOS == "windows" {
err, username, errout := shell.PWSLOut("git config user.name")

uname := strings.TrimSuffix(username, "\n")

if err != nil {
log.Printf("error: %v\n", err)
fmt.Print(errout)
}

return msg + uname + repo
} else {
err, username, errout := shell.ShellOut("git config user.name")

uname := strings.TrimSuffix(username, "\n")

if err != nil {
log.Printf("error: %v\n", err)
fmt.Print(errout)
}

return msg + uname + repo
}
}

var (
copyPass bool
version string
Expand Down Expand Up @@ -169,24 +140,11 @@ Will prompt for confirmation when a site path is not unique.`,

cloneCmd = &cobra.Command{
Use: "clone",
Short: cloneHELP(),
Example: "secman /",
Short: clone.Help(),
Example: "secman clone",
Aliases: []string{"cn", "/"},
Run: func(cmd *cobra.Command, args []string){
if runtime.GOOS == "windows"{
shell.PWSLCmd("& $HOME/sm/secman-sync.ps1 cn")
shell.PWSLCmd(
`
if (Test-Path -path ~/.secman) {
$E = [System.Char]::ConvertFromUtf32([System.Convert]::toInt32("2705", 16));
Write-Host "cloned successfully $E"
}
`,
)
} else {
shell.ShellCmd("secman-sync cn")
shell.ShellCmd(`if [ -d ~/.secman ]; then echo "cloned successfully ✅"; fi`)
}
clone.Core()

checker.Checker()
},
Expand Down
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 082cd8 to a35fc7

0 comments on commit 8bbba1c

Please sign in to comment.