mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-13 05:37:21 -05:00
v1.1.13
This commit is contained in:
@@ -18,20 +18,23 @@ const REPO_CONFIG = {
|
||||
'stream-api': { name: 'stream-api', branch: 'main' },
|
||||
};
|
||||
|
||||
const clonedRepos = new Set();
|
||||
|
||||
function clonePrivateRepo(repoConfig, targetDir) {
|
||||
if (fs.existsSync(targetDir)) {
|
||||
console.log(`[DEV] ${repoConfig.name} already exists locally. Skipping clone to use local changes.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const token = process.env.GITLAB_TOKEN || process.env.VYLA_GITLAB_TOKEN;
|
||||
const auth = token ? `oauth2:${token}@` : '';
|
||||
const repoUrl = `https://${auth}gitlab.com/${GITLAB_GROUP}/${repoConfig.name}.git`;
|
||||
|
||||
try {
|
||||
if (fs.existsSync(targetDir)) {
|
||||
fs.rmSync(targetDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
||||
}
|
||||
|
||||
execSync(`git clone --depth 1 --branch ${repoConfig.branch} ${repoUrl} ${targetDir}`, {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
|
||||
clonedRepos.add(repoConfig.name);
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to clone ${repoConfig.name}: ${error.message}`);
|
||||
}
|
||||
@@ -332,9 +335,11 @@ async function build() {
|
||||
fs.writeFileSync(path.join(__dirname, 'manifest.json'), JSON.stringify(manifest, null, 2), 'utf8');
|
||||
|
||||
for (const repo of REPOS) {
|
||||
const repoPath = path.join(__dirname, repo);
|
||||
if (fs.existsSync(repoPath)) {
|
||||
fs.rmSync(repoPath, { recursive: true, force: true });
|
||||
if (clonedRepos.has(repo)) {
|
||||
const repoPath = path.join(__dirname, repo);
|
||||
if (fs.existsSync(repoPath)) {
|
||||
fs.rmSync(repoPath, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
41
main.js
41
main.js
@@ -203,10 +203,34 @@ async function start() {
|
||||
|
||||
try {
|
||||
sendToTauri('status', { message: 'Inspecting local workspace and installed files...' });
|
||||
const isFirstRun = !patcher.verifyExtraction();
|
||||
const localVersion = patcher.getCurrentVersion();
|
||||
const localSha = patcher.getCurrentSha();
|
||||
debugLog(`Is First Run: ${isFirstRun}, Local Version: ${localVersion}`);
|
||||
let isFirstRun = !patcher.verifyExtraction();
|
||||
let localVersion = patcher.getCurrentVersion();
|
||||
let localSha = patcher.getCurrentSha();
|
||||
debugLog(`Is First Run: ${isFirstRun}, Local Version: ${localVersion}, Local SHA: ${localSha}`);
|
||||
|
||||
const localZipPath = path.join(__dirname, 'update-payload.zip');
|
||||
const localManifestPath = path.join(__dirname, 'manifest.json');
|
||||
let localZipManifest = null;
|
||||
|
||||
if (fs.existsSync(localZipPath) && fs.existsSync(localManifestPath)) {
|
||||
try { localZipManifest = JSON.parse(fs.readFileSync(localManifestPath, 'utf8')); } catch (e) { }
|
||||
}
|
||||
|
||||
if (localZipManifest && (isFirstRun || localZipManifest.sha256 !== localSha)) {
|
||||
debugLog("New local payload detected! Applying local build...");
|
||||
sendToTauri('status', { message: 'Extracting local development payload...' });
|
||||
patcher.purgeOldCode();
|
||||
patcher.extractZipPayload(localZipPath);
|
||||
patcher.applyPatches(getReplacementsConfig());
|
||||
patcher.bridgeCredentials(serviceManager.credentialManager);
|
||||
patcher.saveCurrentVersion(localZipManifest.version, localZipManifest.sha256);
|
||||
serviceManager.envConfig = getEnvConfig();
|
||||
|
||||
isFirstRun = false;
|
||||
localVersion = localZipManifest.version;
|
||||
localSha = localZipManifest.sha256;
|
||||
debugLog("Local payload applied successfully.");
|
||||
}
|
||||
|
||||
sendToTauri('status', { message: 'Connecting to update servers...' });
|
||||
let release = null;
|
||||
@@ -277,7 +301,14 @@ async function start() {
|
||||
patcher.extractZipPayload(localZip);
|
||||
patcher.applyPatches(getReplacementsConfig());
|
||||
patcher.bridgeCredentials(serviceManager.credentialManager);
|
||||
patcher.saveCurrentVersion("1.0.0");
|
||||
|
||||
let ver = "1.0.0";
|
||||
try {
|
||||
const man = JSON.parse(fs.readFileSync(path.join(__dirname, 'manifest.json'), 'utf8'));
|
||||
ver = man.version || ver;
|
||||
} catch (e) { }
|
||||
|
||||
patcher.saveCurrentVersion(ver);
|
||||
serviceManager.envConfig = getEnvConfig();
|
||||
debugLog("Local payload extracted successfully.");
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vyla-home",
|
||||
"version": "1.1.12",
|
||||
"version": "1.1.13",
|
||||
"description": "Vyla Home Desktop App Launcher",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -4222,7 +4222,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vyla-home"
|
||||
version = "1.1.12"
|
||||
version = "1.1.13"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"serde",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vyla-home"
|
||||
version = "1.1.12"
|
||||
version = "1.1.13"
|
||||
description = "Vyla Home Desktop App Launcher"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=src/main.rs");
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json");
|
||||
|
||||
if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {
|
||||
if let (Ok(manifest_dir), Ok(out_dir)) = (std::env::var("CARGO_MANIFEST_DIR"), std::env::var("OUT_DIR")) {
|
||||
let mut target_dir = std::path::PathBuf::from(out_dir);
|
||||
target_dir.pop();
|
||||
target_dir.pop();
|
||||
target_dir.pop();
|
||||
let dll_src = std::path::Path::new(&manifest_dir).join("WebView2Loader.dll");
|
||||
let dll_dest = target_dir.join("WebView2Loader.dll");
|
||||
if dll_src.exists() {
|
||||
let _ = std::fs::copy(dll_src, dll_dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tauri_build::build();
|
||||
}
|
||||
@@ -570,6 +570,41 @@ fn main() {
|
||||
let app_data = app.path().app_data_dir().unwrap_or_default();
|
||||
let app_data_str = clean_path(&app_data);
|
||||
|
||||
let vyla_files = if let Ok(appdata_env) = std::env::var("APPDATA") {
|
||||
std::path::PathBuf::from(appdata_env).join("vyla-home").join("vyla-home-files")
|
||||
} else {
|
||||
app_data.join("vyla-home-files")
|
||||
};
|
||||
|
||||
let version_file = vyla_files.join("version.json");
|
||||
let current_app_version = app.package_info().version.to_string();
|
||||
let mut version_mismatch = false;
|
||||
|
||||
if version_file.exists() {
|
||||
if let Ok(content) = std::fs::read_to_string(&version_file) {
|
||||
if let Ok(json) = serde_json::from_str::<serde_json::Value>(&content) {
|
||||
if let Some(version) = json.get("version").and_then(|v| v.as_str()) {
|
||||
if version != current_app_version {
|
||||
version_mismatch = true;
|
||||
}
|
||||
} else {
|
||||
version_mismatch = true;
|
||||
}
|
||||
} else {
|
||||
version_mismatch = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if version_mismatch {
|
||||
debug_log(&format!("App version updated to {}. Cleaning old files.", current_app_version));
|
||||
let dirs_to_remove = ["frontend", "player", "stream-api", "auth-proxy", "config"];
|
||||
for d in dirs_to_remove {
|
||||
let _ = std::fs::remove_dir_all(vyla_files.join(d));
|
||||
}
|
||||
let _ = std::fs::remove_file(&version_file);
|
||||
}
|
||||
|
||||
let window = WebviewWindowBuilder::new(app, "main", WebviewUrl::App("index.html".into()))
|
||||
.title("Vyla Home")
|
||||
.inner_size(1280.0, 800.0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Vyla Home",
|
||||
"version": "1.1.12",
|
||||
"version": "1.1.13",
|
||||
"identifier": "com.vyla.home",
|
||||
"build": {
|
||||
"frontendDist": "../ui"
|
||||
|
||||
Reference in New Issue
Block a user