slint/api/node/build-on-demand.mjs
Aurindam Jana 0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00

21 lines
805 B
JavaScript

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
// This file checks if a binary package was installed (through architecture dependencies), and
// builds slint if no binary was found.
import { Worker } from "node:worker_threads";
import { spawn } from "child_process";
const worker = new Worker("./rust-module.cjs")
// Define dummy error handler to prevent node from aborting on errors
worker.on('error', (error) => { console.log(`Error loading rust-module.cjs: {error}`) })
worker.on('exit', (code) => {
if (code != 0) {
console.log("slint-ui: loading rust-module.cjs failed, building now")
spawn("npm", ["run", "build"], {
stdio: 'inherit'
})
}
})