Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
✨ tale-cli log
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Jun 10, 2018
1 parent 254b074 commit d1b33ee
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cmds/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ func StartAction() error {
func StopAction() error {
dat, err := ioutil.ReadFile(pidFile)
if err != nil {
return err
log.Println("博客程序已经停止")
return nil
}
log.Println("pid:", strings.TrimSpace(string(dat)))

Expand Down Expand Up @@ -64,10 +65,6 @@ func RestartAction() error {

// StatusAction 查看博客运行状态
func StatusAction() error {
// if _, err := os.Stat(pidFile); os.IsNotExist(err) {
// log.Panicln("博客已经停止运行")
// return nil
// }
dat, err := ioutil.ReadFile(pidFile)
if err != nil {
log.Println("博客已经停止运行")
Expand Down Expand Up @@ -96,9 +93,9 @@ func LogAction() error {
if err != nil {
return err
}
io.Copy(os.Stderr, stderr)
io.Copy(os.Stdout, stdout)
return nil
go io.Copy(os.Stdout, stdout)
go io.Copy(os.Stderr, stderr)
select {}
}

// UpgradeAction 升级博客
Expand Down

0 comments on commit d1b33ee

Please sign in to comment.