Skip to content

Commit

Permalink
Remove obtaining workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
SKevo18 committed Feb 11, 2024
1 parent 3c2bcc5 commit e09f1d3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/cmd/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package cmd

import (
"log"
"os"
"path/filepath"

"github.com/spf13/cobra"

Expand All @@ -17,18 +15,9 @@ func genericTransform(action string) func(cmd *cobra.Command, args []string) {
dataFileLocation := args[1]
folderPath := args[2]

// get work dir, convert to absolute
wd, err := os.Getwd()
if err != nil {
log.Fatal("Failed to obtain working directory: ", err.Error())
}
folderPath = filepath.Join(wd, folderPath)
dataFileLocation = filepath.Join(wd, dataFileLocation)

// go!
log.Printf("Beginning the %sing of files from data file `%s` into output folder `%s` for game `%s`...\n", action, dataFileLocation, folderPath, gameID)
err = transformers.Transform(action, gameID, dataFileLocation, folderPath)
if err != nil {
if err := transformers.Transform(action, gameID, dataFileLocation, folderPath); err != nil {
log.Fatal("Fatal error: ", err.Error())
}

Expand Down

0 comments on commit e09f1d3

Please sign in to comment.