Skip to content

Commit

Permalink
delete old expath
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 5, 2023
1 parent 1249c94 commit 412996c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"strings"
"time"
Expand All @@ -21,7 +20,6 @@ var (
folderPath string = os.Getenv("PUTIO_WATCH_FOLDER")
putioToken string = os.Getenv("PUTIO_TOKEN")
downloadFolderID string = os.Getenv("PUTIO_DOWNLOAD_FOLDER_ID")
exPath string
)

func connectToPutio() (*putio.Client, error) {
Expand Down Expand Up @@ -54,7 +52,7 @@ func uploadTorrentToPutio(filename string, filepath string, client *putio.Client
}

// Using open since Upload need an *os.File variable
file, err := os.Open(folderPath + "/" + filename)
file, err := os.Open(filename)
if err != nil {
str := fmt.Sprintf("Openfile err: %v", err)
err := errors.New(str)
Expand Down Expand Up @@ -85,7 +83,7 @@ func transferMagnetToPutio(filename string, filepath string, client *putio.Clien
}

// Reading the link inside the magnet file to give to Putio
magnetData, err := ioutil.ReadFile(folderPath + "/" + filename)
magnetData, err := ioutil.ReadFile(filename)
if err != nil {
str := fmt.Sprintf("Couldn't read file %v: %v", filename, err)
err := errors.New(str)
Expand Down Expand Up @@ -213,13 +211,6 @@ func checkEnvVariables() error {
func main() {
log.Println("Krantor Started")

ex, err := os.Executable()
if err != nil {
panic(err)
}
exPath = filepath.Dir(ex)
fmt.Println(exPath)

client, err := connectToPutio()
if err != nil {
log.Fatalln("connection to Putio err: ", err)
Expand Down

0 comments on commit 412996c

Please sign in to comment.