Skip to content

Commit d7f78e8

Browse files
committed
Hotfix to remove my hardcoded user ID
1 parent b85e789 commit d7f78e8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ struct Args {
4141
/// Generate a TypeScript definition file for roblox-ts users.
4242
#[arg(short, long)]
4343
typescript: bool,
44+
45+
#[arg(short, long)]
46+
user_id: u64,
4447
}
4548

4649
const LOCKFILE_PATH: &str = "asphalt.lock.toml";
@@ -102,7 +105,8 @@ async fn main() {
102105
}
103106

104107
if asset_id.is_none() {
105-
asset_id = Some(upload_asset(path.clone(), asset_type, api_key.clone()).await);
108+
asset_id =
109+
Some(upload_asset(path.clone(), asset_type, api_key.clone(), args.user_id).await);
106110
println!("Uploaded {}", style(path_str).green());
107111
}
108112

src/upload.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ async fn get_image_id(asset_id: u64) -> u64 {
6363
id_str.parse::<u64>().unwrap()
6464
}
6565

66-
pub async fn upload_asset(path: PathBuf, asset_type: AssetType, api_key: String) -> u64 {
66+
pub async fn upload_asset(
67+
path: PathBuf,
68+
asset_type: AssetType,
69+
api_key: String,
70+
user_id: u64,
71+
) -> u64 {
6772
let path_str = path.to_str().unwrap();
6873

6974
let create_params = CreateAssetParams {
@@ -74,7 +79,7 @@ pub async fn upload_asset(path: PathBuf, asset_type: AssetType, api_key: String)
7479
display_name: path_str.to_string(),
7580
creation_context: AssetCreationContext {
7681
creator: AssetCreator::User(AssetUserCreator {
77-
user_id: "9670971".to_string(),
82+
user_id: user_id.to_string(),
7883
}),
7984
expected_price: None,
8085
},

0 commit comments

Comments
 (0)