Carpet

Carpet

2M Downloads

[Scarpet] App resource type is unable to load apps

altrisi opened this issue ยท 3 comments

commented

I'm currently trying to make a kind-of installer for the world-edit app to place it on the app store while still keeping it in its own repo.

However, I'm facing a problem: Downloaded resources, even of app type, cannot be loaded as actual apps since they are downloaded to either app data or shared app data. That renders the app downloading feature almost useless since it can't ever be used to download neither apps or libraries from wherever, app store or custom url.

Also, in case this functionality gets added to the app type only: Is there a way to specify an app resource type from a remote url, such as another repository?

Alternative: I could use some ugly run('script download...') by setting the app store url carpet rule and similar things, but I'd prefer not to.

commented

currently the resources section is only used to pull in data - either shared or app's. Some basic principle of OS design is that code is not data, and data is not code. (data can be altered, code should not). I haven't thought about libraries (.scl) though - I think apps should be able to request them, which technically would be equivalent of running run(/script download ...), but done possibly more elegantly.

due to possible version conflicts, apps should be able to install libraries and keep them separate from other apps, but for now, it could just be placed like any other apps.

/scripts
  /trash
  /shared
    data.txt
  foo.sc imports lib
  /foo.data
    bar.json
  lib.scl
  /lib.data
    baz.zip

vs

/scripts
  /trash
  /shared
    data.txt
  foo.sc imports lib
  /foo.data
    bar.json
  /foo.libs
    lib.scl
    /lib.data
      baz.zip

for that import for apps should be looking into `.lib' folder as well when importing

Technically /script remove could stay the same in this case - if you don't have access to foo.sc, then libs will be unaccessible as well.

commented

only problem is that config is technically in the code, and apps would read it after its executed.
Thankfully __config gets applied (mostly) as its read, meaning if the import statements are after config definition, then the imports may happen after app is fully installed and other libraries are placed. That would need to be specified in the docs

commented

Oops, didn't get to read your comment and implemented my view in #956, will read it later and change if needed, I'm out of time rn.