Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "asphalt"
version = "2.0.0"
version = "2.0.1"
edition = "2024"
description = "Upload and reference Roblox assets in code"
readme = "README.md"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ output_path = "src/shared"
- A glob pattern to match files to upload.
- `output_path`: string
- The directory path to output the generated code.
- `output_basename`: string
- The filename of the generated files. Defaults to the input's name.
- `web`: map<string, [WebAsset](#webasset)>
- A map of paths relative to the input path to existing assets on Roblox.
- `bleed`: boolean (optional)
Expand Down
7 changes: 7 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
"type": "boolean",
"default": true
},
"output_basename": {
"description": "The basename of the file to output the generated code",
"type": [
"string",
"null"
]
},
"output_path": {
"description": "The directory path to output the generated code",
"type": "string"
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ pub struct Input {
/// The directory path to output the generated code
pub output_path: PathBuf,

/// The basename of the file to output the generated code
pub output_basename: Option<String>,

/// Enable alpha bleeding images. Keep in mind that changing this setting won't invalidate your lockfile or reupload your images
#[serde(default = "default_true")]
pub bleed: bool,
Expand Down
4 changes: 3 additions & 1 deletion src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ pub async fn sync(args: SyncArgs, mp: MultiProgress) -> anyhow::Result<()> {

let output_path = config.project_dir.join(&input.output_path);
fs::create_dir_all(&output_path).await?;
fs::write(output_path.join(format!("{input_name}.{ext}")), code).await?;

let base_name = &input.output_basename.as_deref().unwrap_or(&input_name);
fs::write(output_path.join(format!("{base_name}.{ext}")), code).await?;
}
}

Expand Down