Skip to content

Commit

Permalink
refactor: remove license files and move to placeholders only
Browse files Browse the repository at this point in the history
  • Loading branch information
nuke-web3 committed Nov 18, 2024
1 parent e2e0a9c commit e567ee8
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 1,064 deletions.
2 changes: 1 addition & 1 deletion cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cargo_generate_version = ">=0.22"

[placeholders]
description = { type = "text", prompt = "Long description for the app:" }
description = { type = "string", prompt = "App description:", default = "An App built for COSMIC, based on the [`libcosmic` template](https://github.com/pop-os/cosmic-app-template/" }
repository-url = { type = "string", prompt = "Repository URL (https://*)", regex = "^https?:\\/\\/(www\\.)?[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$" }
app-id = { type = "string", prompt = "App ID (com.example.MyCosmicApp)", regex = "^[a-zA-Z0-9]+\\.[a-zA-Z0-9]+\\.[a-zA-Z0-9]+$" }

Expand Down
23 changes: 5 additions & 18 deletions generate/license.rhai
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
// This example script asks and reacts to the the users selection of license
// This example script asks the users selection of license

print("Please select *a valid* identifier from <https://github.com/spdx/license-list-data/blob/v3.20/licenses.md>");
let license = variable::prompt("Which license do you want to use?",
"MPL-2.0",
["MPL-2.0",
"MIT",
"AGPL-3.0",
"Apache-2.0",
"Unlicense",
"Custom",
"(Other)",
"None"
]
);

if license == "Custom" {
print("You selected to use a *custom* license");
print("Please *manually* add a correct LICENSE file");
print("Also update source files *manually* to reference your license choice");
if license == "(Other)" {
license = variable::prompt("Please define *a valid* identifier from <https://github.com/spdx/license-list-data/blob/v3.20/licenses.md>")
}

print(`📝 Remeber to add a correct LICENSE file for ${license} - found at <https://github.com/spdx/license-list-data/blob/v3.20/licenses.md> `);
variable::set("license", license);

if license != "None" {
file::rename(`generate/licenses/${license}`, "LICENSE");
}

// Some licenses require a copyright year
// Cargo generate's `authors` is used for owner
let _year = system::date().year;
let year = `${_year}`;
variable::set("year", year);

662 changes: 0 additions & 662 deletions generate/licenses/AGPL-3.0

This file was deleted.

203 changes: 0 additions & 203 deletions generate/licenses/Apache-2.0

This file was deleted.

3 changes: 0 additions & 3 deletions generate/licenses/Custom

This file was deleted.

8 changes: 0 additions & 8 deletions generate/licenses/MIT

This file was deleted.

Loading

0 comments on commit e567ee8

Please sign in to comment.