Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Tom Clancy's Rainbow Six 3 : Raven Shield" script #1181

Open
madoar opened this issue Jan 5, 2020 · 4 comments
Open

Update "Tom Clancy's Rainbow Six 3 : Raven Shield" script #1181

madoar opened this issue Jan 5, 2020 · 4 comments

Comments

@madoar
Copy link
Collaborator

madoar commented Jan 5, 2020

The following changes should be done:

  • change var to const
  • think about replacing Downloader by Resource

new Downloader()
.wizard(wizard)
.url(url)
.checksum(sha1)
.to(originDirectory + exeName)
.get();
wine.run(originDirectory + exeName);

@plata
Copy link
Collaborator

plata commented Jan 5, 2020

The var to const is done. What's the advantage of using Resource? Shouldn't Resource be used only for stuff which is shared between scripts? If you use it to download big files, I think they will remain in the resources directory and fill up your hard drive.

@Zemogiter
Copy link
Contributor

At least you won't have to redownload them everytime.

@plata
Copy link
Collaborator

plata commented Jan 5, 2020

Yes, if you install the app again. That's not the normal use case as far as I'm concerned.

For example in verbs it's different: As multiple apps might use the same verbs, it makes sense to keep the resource.

@madoar
Copy link
Collaborator Author

madoar commented Jan 5, 2020

It is not only about keeping the resource. I see two possible benefits of using Resource over Downloader:

  • Resource could be imagined as a temporary object (i.e. file or directory) that is automatically deleted after exiting the script. This is useful for example when downloading archives or installers that should be deleted afterwards anyway
  • Resource returns the path leading to the downloaded file, this means that you don't need to do any path building on the calling site (e.g. originDirectory + exeName). This reduces the number of possible errors a script developer can do (for example I'm often asking myself the question: Is there a "/" missing between originDirectory and exeName?)

In addition Resource uses Downloader internally so it is essentially the same anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants