Skip to content

Commit

Permalink
Feature/curseforge open (#7)
Browse files Browse the repository at this point in the history
* Add go concurrency to VerifyFolders, add OpenCurseforge

* Add curseforge items

* Add curseforge open function and test

* Update readme
  • Loading branch information
ldougbmx authored Jan 10, 2022
1 parent 7acae5c commit c4c7837
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The latest release can be found here: https://github.com/ldougbmx/wowtools/relea
* The README and LICENSE files are also included in the release
* Place the files anywhere on your system (but both in the same directory)
* Verify/Update the wowtools-cli.yml to set custom paths if needed
* The curseforge_args will need to be filled out for Curseforge to open. If they are not, only the full full Overwolf app will open.
* These can be grabbed from the Curseforge exe by right-clicking and selecting Properties.
* Copy the target -launchapp xxxxxxxxxxxxxxxxx -from-startmenu section and insert it into the yml.
* Run wowtools.exe

## Usage
Expand All @@ -24,6 +27,7 @@ Update the wowtools-cli.yml file if you have WoW installed in a custom location.
2. Deletes current ElvUI install in the Addons directory
3. Downloads latest zip of ElvUI
4. Unzips and moves folder to your Addons directory
4. Asks user if they want to open the Curseforge application

## Planned enhancements
* Implement CLI commands to allow users to perform specific actions on demand.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
func main() {
cmd.InitConfig()
utilities.VerifyFolders(viper.GetString("backup_dir"))
utilities.VerifyFolders(viper.GetString("backup_dir") + "ElvUI")
utilities.VerifyFolders(viper.GetString("backup_dir") + "WTF")
go utilities.VerifyFolders(viper.GetString("backup_dir") + "ElvUI")
go utilities.VerifyFolders(viper.GetString("backup_dir") + "WTF")
cmd.WtfBackup()
cmd.UpdateElvUI()
utilities.OpenCurseforge()
}
21 changes: 21 additions & 0 deletions test/startCurseforge_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package test

import (
"fmt"
"os/exec"
"testing"

"github.com/spf13/viper"
)

func TestCurseforgeOpener(t *testing.T) {
curseforgeExe := viper.GetString("curseforge_exe")
curseforgeArgs := viper.GetString("curseforge_args")

fmt.Println("Opening Cureseforge")
cmd := exec.Command("powershell", "Start-Process",
fmt.Sprintf("-Filepath '%s'", curseforgeExe),
fmt.Sprintf("-ArgumentList '%s'", curseforgeArgs),
)
fmt.Println(cmd.String())
}
25 changes: 25 additions & 0 deletions utilities/curseforgeOpener.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package utilities

import (
"fmt"
"log"
"os/exec"

"github.com/spf13/viper"
)

func OpenCurseforge() {
curseforgeExe := viper.GetString("curseforge_exe")
curseforgeArgs := viper.GetString("curseforge_args")
updatePrompt := AskForConfirmation("Do you want to launch Curseforge to update addons?")
if updatePrompt {
fmt.Println("Opening Cureseforge")
cmd := exec.Command("powershell", "Start-Process",
fmt.Sprintf("-Filepath '%s'", curseforgeExe),
fmt.Sprintf("-ArgumentList '%s'", curseforgeArgs))
err := cmd.Start()
if err != nil {
log.Fatal(err)
}
}
}
4 changes: 3 additions & 1 deletion wowtools-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ wtf_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\WTF"
backup_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Backups\\"
elvui_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Interface\\AddOns\\ElvUI\\"
elvui_options_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Interface\\AddOns\\ElvUI_OptionsUI\\"
addons_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Interface\\AddOns"
addons_dir: "C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Interface\\AddOns"
curseforge_exe: "C:\\Program Files (x86)\\Overwolf\\OverwolfLauncher.exe"
curseforge_args: "-launchapp xxxxxxxxxxxxxxxxxxxxxxxxxx -from-startmenu"

0 comments on commit c4c7837

Please sign in to comment.