From 4609be20deee44f61692dddd9900f3c05423a675 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 11 Jan 2023 17:52:18 -0800 Subject: [PATCH] WIP: Adding license compliance to CI --- licenses/test.tx | 1 + licenses/test.txt | 1 + script/collect-licenses.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 licenses/test.tx create mode 100644 licenses/test.txt create mode 100755 script/collect-licenses.js diff --git a/licenses/test.tx b/licenses/test.tx new file mode 100644 index 0000000000..9f27c62f59 --- /dev/null +++ b/licenses/test.tx @@ -0,0 +1 @@ +DATA DATA DATA \ No newline at end of file diff --git a/licenses/test.txt b/licenses/test.txt new file mode 100644 index 0000000000..b18c75c886 --- /dev/null +++ b/licenses/test.txt @@ -0,0 +1 @@ +Test test \ No newline at end of file diff --git a/script/collect-licenses.js b/script/collect-licenses.js new file mode 100755 index 0000000000..a0193a4899 --- /dev/null +++ b/script/collect-licenses.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +const fs = require('fs'); + +const file_name = (path) => "./licenses/".concat(path); + +const writeFile = (path, data) => { + fs.writeFile(file_name(path), data, (err) => { + if (err) throw err; + console.log("Saved file") + }); +} + +main(); + +async function main() { + console.log("Here!"); + + writeFile("test.tx", "DATA DATA DATA") + + // Next steps: + // 1a. Add wiring in Zed to check for a licenses markdown file + // 1b. Add wiring in Zed.dev for builds to publish licenses alongside releases as well as licenses for Zed.dev itself + // 2. Figure out how to run those commands and get the license text for each MIT and Apache licensed software + // 3. Add in the configuration file: + // a. and refactor this script to have types of licenses + // b. add callback handlers for each type, + // c. check if the handler succeeds +} \ No newline at end of file