Commit 0e7540de52
Unsigned
Layout: unified · split
Build/CurdInstaller.exe added
Binary file not shown.
build → Build/build renamed
Build/buildwindows added +4
| @@ -0,0 +1,4 @@ | ||
| 1 | @echo off | |
| 2 | set GOOS=windows | |
| 3 | set GOARCH=amd64 | |
| 4 | go build -o curd.exe -ldflags="-s -w" -trimpath cmd\curd\main.go | |
| \ No newline at end of file | ||
Build/curd-windows-build.iss added
Build/curd-windows-build_original.iss added +25
| @@ -0,0 +1,25 @@ | ||
| 1 | [Setup] | |
| 2 | AppName=Curd Installer | |
| 3 | AppVersion=1.0 | |
| 4 | DefaultDirName={pf}\Curd | |
| 5 | DefaultGroupName=Curd | |
| 6 | AllowNoIcons=yes | |
| 7 | OutputBaseFilename=CurdInstaller | |
| 8 | UsePreviousAppDir=yes | |
| 9 | Compression=lzma2 | |
| 10 | SolidCompression=yes | |
| 11 | ||
| 12 | [Tasks] | |
| 13 | ; Define a task for creating a desktop shortcut | |
| 14 | Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional Options"; | |
| 15 | ||
| 16 | [Files] | |
| 17 | ; Copy the Curd executable to the install directory | |
| 18 | Source: "C:\Users\Rushikesh\Documents\Projects\curd\curd.exe"; DestDir: "{app}"; Flags: ignoreversion | |
| 19 | Source: "C:\Users\Rushikesh\Documents\Projects\curd\bin\mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion | |
| 20 | ||
| 21 | [Icons] | |
| 22 | ; Create the application icon in the Start Menu | |
| 23 | Name: "{group}\Curd"; Filename: "{app}\curd.exe" | |
| 24 | ; Create a desktop shortcut if the user checked the option | |
| 25 | Name: "{userdesktop}\Curd"; Filename: "{app}\curd.exe"; Tasks: desktopicon | |
Build/curd.exe added
Binary file not shown.
Build/curd.ico added
Binary file not shown.
Build/curd.jpg added
Binary file not shown.
cmd/curd/main.go +22 −22
| @@ -100,29 +100,29 @@ func main() { | ||
| 100 | 100 | userCurdConfig.SubOrDub = "dub" |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | // Get the token from the token file | |
| 104 | user.Token, err = internal.GetTokenFromFile(filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token")) | |
| 105 | if err != nil { | |
| 106 | internal.Log("Error reading token", logFile) | |
| 107 | } | |
| 108 | if user.Token == "" { | |
| 109 | fmt.Println("No token found, please generate a token from https://anilist.co/api/v2/oauth/authorize?client_id=20686&response_type=token") | |
| 110 | fmt.Scanln(&user.Token) | |
| 111 | internal.WriteTokenToFile(user.Token, filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token")) | |
| 112 | } | |
| 113 | ||
| 114 | // Load animes in database | |
| 115 | databaseFile := filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "curd_history.txt") | |
| 116 | databaseAnimes := internal.LocalGetAllAnime(databaseFile) | |
| 117 | ||
| 118 | if *addNewAnime { | |
| 119 | internal.AddNewAnime(&userCurdConfig, &anime, &user, &databaseAnimes, logFile) | |
| 120 | internal.ExitCurd() | |
| 121 | } | |
| 103 | // Get the token from the token file | |
| 104 | user.Token, err = internal.GetTokenFromFile(filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token")) | |
| 105 | if err != nil { | |
| 106 | internal.Log("Error reading token", logFile) | |
| 107 | } | |
| 108 | if user.Token == "" { | |
| 109 | fmt.Println("No token found, please generate a token from https://anilist.co/api/v2/oauth/authorize?client_id=20686&response_type=token") | |
| 110 | fmt.Scanln(&user.Token) | |
| 111 | internal.WriteTokenToFile(user.Token, filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token")) | |
| 112 | } | |
| 113 | ||
| 114 | // Load animes in database | |
| 115 | databaseFile := filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "curd_history.txt") | |
| 116 | databaseAnimes := internal.LocalGetAllAnime(databaseFile) | |
| 117 | ||
| 118 | if *addNewAnime { | |
| 119 | internal.AddNewAnime(&userCurdConfig, &anime, &user, &databaseAnimes, logFile) | |
| 120 | internal.ExitCurd() | |
| 121 | } | |
| 122 | 122 | |
| 123 | internal.SetupCurd(&userCurdConfig, &anime, &user, &databaseAnimes, logFile) | |
| 124 | ||
| 125 | temp_anime, err := internal.FindAnimeByAnilistID(user.AnimeList, strconv.Itoa(anime.AnilistId)) | |
| 123 | internal.SetupCurd(&userCurdConfig, &anime, &user, &databaseAnimes, logFile) | |
| 124 | ||
| 125 | temp_anime, err := internal.FindAnimeByAnilistID(user.AnimeList, strconv.Itoa(anime.AnilistId)) | |
| 126 | 126 | if err != nil { |
| 127 | 127 | internal.Log("Error finding anime by Anilist ID: "+err.Error(), logFile) |
| 128 | 128 | } |