Files
Unify/framework/npmScripts/release.js

197 lines
4.0 KiB
JavaScript
Raw Normal View History

2025-12-25 11:16:59 +01:00
/*
Copyright (c) 2020, 2023, The Unified Company.
This code is part of Unify.
This program is free software; you can redistribute it and/or modify
it under the terms of the ESA Software Community License - Strong Copyleft,
https://unifyjs.org
*/
import fs from "fs-extra";
//process.chdir('../../');
// Framework
if( fs.existsSync( "framework/node_modules/esbuild/node_modules" ) ) {
fs.rmSync("framework/node_modules/esbuild/node_modules", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/ws/node_modules" ) ) {
fs.rmSync("framework/node_modules/ws/node_modules", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/better-sqlite3/node_modules" ) ) {
fs.rmSync("framework/node_modules/better-sqlite3/node_modules", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/caxa/node_modules" ) ) {
fs.rmSync("framework/node_modules/caxa/node_modules", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/esbuild/package-lock.json" ) ) {
fs.rmSync("framework/node_modules/esbuild/package-lock.json", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/ws/package-lock.json" ) ) {
fs.rmSync("framework/node_modules/ws/package-lock.json", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/better-sqlite3/package-lock.json" ) ) {
fs.rmSync("framework/node_modules/better-sqlite3/package-lock.json", { recursive: true });
}
if( fs.existsSync( "framework/node_modules/caxa/package-lock.json" ) ) {
fs.rmSync("framework/node_modules/caxa/package-lock.json", { recursive: true });
}
if( fs.existsSync( "./node_modules" ) ) {
fs.rmSync("./node_modules", { recursive: true });
}
if( fs.existsSync( "./framework/cache/platforms" ) ) {
fs.rmSync("./framework/cache/platforms", { recursive: true });
}
fs.mkdirSync("./framework/cache/platforms");
if( fs.existsSync( "./framework/cache/server" ) ) {
fs.rmSync("./framework/cache/server", { recursive: true });
}
fs.mkdirSync("./framework/cache/server");
if( fs.existsSync( "./package-lock.json" ) ) {
fs.rmSync("./package-lock.json", { recursive: true });
}
// Native
if( fs.existsSync( "./platforms/hybrid/binaries/nw" ) ) {
fs.rmSync("./platforms/hybrid/binaries/nw", { recursive: true });
}
if( fs.existsSync( "./platforms/hybrid/package-lock.json" ) ) {
fs.rmSync("./platforms/hybrid/package-lock.json", { recursive: true });
}
if( fs.existsSync( "./platforms/hybrid/node_modules" ) ) {
fs.rmSync("./platforms/hybrid/node_modules", { recursive: true });
}
/*
if( fs.existsSync( "./platforms/hybrid/framework/cache/platforms" ) ) {
fs.rmSync("./platforms/hybrid/framework/cache/platforms", { recursive: true });
}
fs.mkdirSync("./platforms/hybrid/framework/cache/platforms");
if( fs.existsSync( "./platforms/hybrid/framework/cache/server" ) ) {
fs.rmSync("./platforms/hybrid/framework/cache/server", { recursive: true });
}
fs.mkdirSync("./platforms/hybrid/framework/cache/server");
*/
// Android
/*
if( fs.existsSync( "./platforms/android/projectRoot//framework/cache/platforms" ) ) {
fs.rmSync("./platforms/android/projectRoot/framework/cache/platforms", { recursive: true });
}
fs.mkdirSync("./platforms/android/projectRoot/framework/cache/platforms");
if( fs.existsSync( "./platforms/android/projectRoot//framework/cache/server" ) ) {
fs.rmSync("./platforms/android/projectRoot/framework/cache/server", { recursive: true });
}
*/
if( fs.existsSync( "./platforms/android/projectRoot//package-lock.json" ) ) {
fs.rmSync("./platforms/android/projectRoot/package-lock.json", { recursive: true });
}
// Executables
if( fs.existsSync( "./executables/application.apk" ) ) {
fs.rmSync("./executables/application.apk", { recursive: true });
}
if( fs.existsSync( "./executables/application" ) ) {
fs.rmSync("./executables/application", { recursive: true });
}
if( fs.existsSync( "./executables/application.exe" ) ) {
fs.rmSync("./executables/application.exe", { recursive: true });
}