Skip to content

Commit fc29a0e

Browse files
committed
Review PR Comments
1 parent 9398e15 commit fc29a0e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

commands/copy.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"path"
1010
"io/ioutil"
11+
"fmt"
1112
)
1213

1314
// Load the content of a given file
@@ -24,45 +25,45 @@ func GetFileContent(filePath string) (string, error) {
2425
func CopyAction(context *cli.Context) error {
2526
cwd, err := os.Getwd()
2627
if err != nil {
27-
color.Red("Failed to list test cases!")
28+
color.Red(fmt.Sprintf("Failed to list test cases : %s", err.Error()))
2829
return err
2930
}
3031

3132
configuration, err := config.LoadDefaultConfiguration()
3233
if err != nil {
33-
color.Red("Failed to load egor configuration")
34+
color.Red(fmt.Sprintf("Failed to load egor configuration: %s", err.Error()))
3435
return err
3536
}
3637

3738
configFileName := configuration.ConfigFileName
3839
metaData, err := config.LoadMetaFromPath(path.Join(cwd, configFileName))
3940
if err != nil {
40-
color.Red("Failed to load egor MetaData ")
41+
color.Red(fmt.Sprintf("Failed to load egor MetaData : %s", err.Error()))
4142
return err
4243
}
4344

4445
taskFile := metaData.TaskFile
4546
taskContent, err := GetFileContent(taskFile)
4647
if err != nil {
47-
color.Red("Failed to load task file content")
48+
color.Red(fmt.Sprintf("Failed to load task file content : %s", err.Error()))
4849
return err
4950
}
5051

5152
err = clipboard.WriteAll(taskContent)
5253
if err != nil {
53-
color.Red("Failed to copy task content to clipboard")
54+
color.Red(fmt.Sprintf("Failed to copy task content to clipboard : %s", err.Error()))
5455
return err
5556
}
5657

57-
color.Green("Done!")
58+
color.Green("Task copied to clipboard successfully")
5859
return nil
5960
}
6061

6162
// Command to copy task source file to clipboard for easy submit.
6263
// Running this command will fetch egor meta data, get the content of the task source
6364
// and then copy the content to the clipboard.
6465
var CopyCommand = cli.Command{
65-
Name: "showcases",
66+
Name: "copy",
6667
Aliases: []string{"cp"},
6768
Usage: "copy task file into clipboad",
6869
UsageText: "list meta data about of the tests cases in the current task",

0 commit comments

Comments
 (0)