mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-13 06:43:01 +03:00
Update the remote convention in leo.toml
This commit is contained in:
parent
b0dcca1345
commit
f5aba15d35
@ -107,8 +107,8 @@ impl CLI for PublishCommand {
|
||||
zip_file.write(&path)?;
|
||||
|
||||
let form_data = Form::new()
|
||||
.text("name", package_name)
|
||||
.text("remote", package_remote)
|
||||
.text("name", package_name.clone())
|
||||
.text("remote", format!("{}/{}", package_remote.author, package_name))
|
||||
.text("version", package_version)
|
||||
.file("file", zip_file.get_file_path(&path))?;
|
||||
|
||||
|
@ -26,13 +26,18 @@ use std::{
|
||||
|
||||
pub const MANIFEST_FILE_NAME: &str = "Leo.toml";
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
pub struct Remote {
|
||||
pub author: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Package {
|
||||
pub name: String,
|
||||
pub version: String,
|
||||
pub description: Option<String>,
|
||||
pub license: Option<String>,
|
||||
pub remote: Option<String>,
|
||||
pub remote: Option<Remote>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@ -77,7 +82,7 @@ impl Manifest {
|
||||
self.package.license.clone()
|
||||
}
|
||||
|
||||
pub fn get_package_remote(&self) -> Option<String> {
|
||||
pub fn get_package_remote(&self) -> Option<Remote> {
|
||||
self.package.remote.clone()
|
||||
}
|
||||
|
||||
@ -98,8 +103,10 @@ impl Manifest {
|
||||
name = "{name}"
|
||||
version = "0.1.0"
|
||||
description = "The {name} package"
|
||||
remote = "[AUTHOR]/{name}"
|
||||
license = "MIT"
|
||||
|
||||
[remote]
|
||||
author = "[AUTHOR]"
|
||||
"#,
|
||||
name = self.package.name
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user