-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5220f20
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
# LPM | ||
|
||
/out | ||
/lpm_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"aliases": { | ||
"lpm": "./lpm_modules/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"luau-lsp.require.directoryAliases": { | ||
"@lpm/": "./lpm_modules/", | ||
"@lune/": "~/.lune/.typedefs/0.8.0/" | ||
}, | ||
"luau-lsp.require.mode": "relativeToFile", | ||
"luau-lsp.types.definitionFiles": [ | ||
"C:\\Users\\plain/.lpm/.typedefs/1.0.1/def.d.lua" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# asset-dl | ||
|
||
Download assets by version. | ||
|
||
## Usage | ||
|
||
```bash | ||
asset-dl <ASSET_ID> <DOWNLOAD PATH> [VERSION NUMBER] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Autogenerated by Spearhead-Industries/lpm | ||
|
||
author = "plainenglish" | ||
description = "CLI Tool for downloading roblox assets by version." | ||
entrypoint = "./src/main.lua" | ||
licence = "MIT" | ||
name = "asset-dl" | ||
repository = "" | ||
version = "1.0.0" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
local process = require("@lune/process"); | ||
local net = require("@lune/net"); | ||
local fs = require("@lune/fs"); | ||
|
||
function main(argc: number, argv: {string}): number | ||
local asset_id = argv[1]; | ||
local output = argv[2]; | ||
local version_id = argv[3]; | ||
|
||
local ver = ""; | ||
if version_id then | ||
ver = `version/{version_id}`; | ||
end | ||
|
||
local info = net.request({ | ||
url = `https://assetdelivery.roblox.com/v1/assetId/{asset_id}/{ver}` | ||
}); | ||
|
||
assert(info.ok, "Request for asset metadata failed."); | ||
info = net.jsonDecode(info.body); | ||
assert(info.location, "No location available"); | ||
|
||
local asset = net.request({ | ||
url = info.location | ||
}); | ||
|
||
assert(asset.ok, "Asset failed to download"); | ||
|
||
fs.writeFile(output, asset.body); | ||
|
||
return 0; | ||
end | ||
|
||
process.exit(main(#process.args, process.args)) |