From 008455a106e841ea6a3fffaf73ffab1d52ccbfef Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 22 Oct 2020 13:14:56 +0200 Subject: [PATCH] Include a license file in the node source package --- api/sixtyfps-node/package.json | 4 +++- xtask/src/nodepackage.rs | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/sixtyfps-node/package.json b/api/sixtyfps-node/package.json index 2b66a44fe..4ed313a8e 100644 --- a/api/sixtyfps-node/package.json +++ b/api/sixtyfps-node/package.json @@ -1,6 +1,8 @@ { "name": "sixtyfps", "version": "0.0.2", + "homepage": "https://github.com/sixtyfpsui/sixtyfps", + "license": "SEE LICENSE IN LICENSE.md", "main": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { @@ -16,4 +18,4 @@ "devDependencies": { "typedoc": "^0.19.2" } -} +} \ No newline at end of file diff --git a/xtask/src/nodepackage.rs b/xtask/src/nodepackage.rs index d169ca358..60dc91f8d 100644 --- a/xtask/src/nodepackage.rs +++ b/xtask/src/nodepackage.rs @@ -8,7 +8,7 @@ Please contact info@sixtyfps.io for more information. LICENSE END */ use anyhow::Context; -use xshell::{cmd, pushd, read_file, write_file}; +use xshell::{cmd, cp, pushd, read_file, rm_rf, write_file}; pub fn generate() -> Result<(), Box> { let root = super::root_dir().context("error determining root directory")?; @@ -39,6 +39,11 @@ pub fn generate() -> Result<(), Box> { write_file(cargo_toml_path.clone(), edited_toml).context("Error writing Cargo.toml")?; + println!("Putting LICENSE.md in place for the source package"); + + cp(root.join("LICENSE.md"), node_dir.join("LICENSE.md")) + .context("Error copying LICENSE.md into the node dir for packaging")?; + println!("Running npm package to create the tarball"); { @@ -52,6 +57,8 @@ pub fn generate() -> Result<(), Box> { write_file(cargo_toml_path, toml_source).context("Error writing Cargo.toml")?; + rm_rf(node_dir.join("LICENSE.md")).context("Error deleting LICENSE.md copy")?; + let package_json_source = read_file(node_dir.join("package.json")).context("Error reading package.json")?;