This repository was archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the new version v5.3.3, and move clone command to folder, update …
…docs
- Loading branch information
Showing
4 changed files
with
87 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule docs
updated
from 082cd8 to a35fc7