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

Add "upload" terminal command #1522

Open
ravenwolf397 opened this issue Jul 27, 2024 · 5 comments
Open

Add "upload" terminal command #1522

ravenwolf397 opened this issue Jul 27, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@ravenwolf397
Copy link

ravenwolf397 commented Jul 27, 2024

Summary: Add a terminal command upload which uploads file(s) from your IRL computer to the game. This is the inverse of the download command.

Currently there exists a command download in the terminal:

download [script/text file]      Downloads scripts or text files to your computer

which downloads files from the game to your IRL computer. If you download multiple files, they will be zipped.

However, no corresponding command exists to upload files from your IRL computer to the game. This means that the download command isn't as useful as it could be, because it cannot effectively be used for:

  • Transferring scripts between games
  • backing up your scripts (backup without restore isn't much)
  • editing your scripts externally without having to set up the API server

This issue is a suggestion to create a command upload which allows the player to select file(s)/folders to upload from their IRL computer to the game. This would be the inverse of the download command.

Effects:

  • Enables easy backup (and restore) of all your scripts and files
  • Creates a mid-point between "edit in your browser" and "install third-party software" for editing scripts
  • Enables easy transfer of scripts between games

Save file: any
Scripts: at least one
Steps: none
Version: v2.6.2 (633da38)

EDIT: Apologies, I can't seem to figure out how to add a label to this - this should be an "enhancement" I think.

@d0sboots
Copy link
Collaborator

d0sboots commented Jul 27, 2024

This command already exists: It is wget. However, it is (intentionally) locked down for file:// URLs, because all access to that URL space is blackholed to prevent real-life exploits. But if you keep your scripts on GitHub (for instance), you can easily wget them into the game from there.

@ravenwolf397
Copy link
Author

ravenwolf397 commented Jul 27, 2024

If it's locked down for file:// URLS then does it really count? I don't want to have to upload my files just to re-download them. That seems a bit silly.

AFAIK file:// access is restricted because it could be accessed without user consent (ie. it allows exploits like you mentioned). This is a restriction performed by the browser ... but the browser still allows normal file uploads, just like it allows normal file downloads. You just have use the system file picking dialog instead of (nonfunctional) URL access.

Right?

@d0sboots
Copy link
Collaborator

but the browser still allows normal file uploads, just like it allows normal file downloads. You just have use the system file picking dialog instead of (nonfunctional) URL access.

That is true; we already use that method with the "import game" dialog, for instance.

But this is a rough for a command-line utility - both for immersion reasons, and also general ergonomics, it would be awkward to start out with upload my_script.js and then have that pop up a file selector dialog. Also, it's an awkward workflow in general to try and use - it's more convenient to use ctrl-A ctrl-C and ctrl-A ctrl-V to copy-paste the whole script into the in-game editor if you want to keep a single file synced without setting up the external integration.

On the whole, I think the combination of copy-paste and wget are going to remain the solutions to this need, although if someone went and implemented an upload command I wouldn't turn it down.

@ravenwolf397
Copy link
Author

Hmmm ... I think I get your point about the workflow.

Thank you for your detailed responses; I really appreciate it.

:)

@gmcew gmcew added the enhancement New feature or request label Jul 27, 2024
@mctylr-gh
Copy link
Contributor

Should it support xmodem, zmodem, 7bit, even or odd parity?

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

No branches or pull requests

4 participants