Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
chore: updated version and removed update checker
Browse files Browse the repository at this point in the history
+ fixed stdlib.crypt.newUuid() error
  • Loading branch information
scarletquasar committed Sep 24, 2023
1 parent d70737e commit 32a0e59
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 233 deletions.
3 changes: 2 additions & 1 deletion projects/core/logic/api/modules/stdlib/encryption-core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { interopCache } from "logic/runtime/interop-cache-core"
import { UUID } from "types/internal/generic-types";

function newUuid(type: "v4" = "v4") {
function newUuid(type: "v4" = "v4"): UUID {
switch(type) {
case "v4":
return interopCache.guid.newGuid();
Expand Down
2 changes: 1 addition & 1 deletion projects/core/logic/runtime/interop-cache-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const interopCache = {
getCurrentProcess: getStaticMethod<any>("System.Diagnostics:Process:GetCurrentProcess")
},
guid: {
newGuid: getStaticMethod<UUID>("System:Guid:NewGuid")
newGuid: _$internalBinding["NewGuid"]
},
web: {
request: _$internalBinding["HttpRequest"]
Expand Down
36 changes: 1 addition & 35 deletions projects/native/Commands/melon.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#! /usr/bin/env node

import axios from "axios";
import path from "path";
import fs from "fs";
import semver from "semver";

import { fileURLToPath } from "url";
import { spawn } from 'child_process';

Expand All @@ -15,37 +11,7 @@ const CURRENT_DIRECTORY = path.dirname(CURRENT_FILE);
const MELON_ENTRY_POINT = "MelonRuntime.CLI.dll";
const MELON_OUTPUT_DIRECTORY = CURRENT_DIRECTORY.replace('Commands', 'Output');

const PACKAGE_PATH = "https://raw.githubusercontent.com/MelonRuntime/Melon/main/projects/melon-runtime/package.json";
const CURRENT_PACKAGE_PATH = CURRENT_DIRECTORY.replace('Commands', 'package.json');

const enableUpdateChecking = process.argv.filter(x => x.startsWith("--")).length > 0;

async function initializeMelon(checkForUpdates) {
if(checkForUpdates) {
try {
const packageContent = await axios.get(PACKAGE_PATH);
const realPackageVersion = packageContent.data.version;

const currentPackageContent = JSON.parse(fs.readFileSync(CURRENT_PACKAGE_PATH));
const currentPackageVersion = currentPackageContent.version;

const updateAvailable = semver.gte(realPackageVersion, currentPackageVersion);

if (updateAvailable) {
console.log("╭───────────────────────────────────────────────────────╮");
console.log("│ New Melon Runtime update available! │");
console.log(`│ ${currentPackageVersion} >>> ${realPackageVersion} │`);
console.log("│ Use npm i melon-runtime -g to update. │");
console.log("╰───────────────────────────────────────────────────────╯");
}
}
catch(e) {
console.error("╭───────────────────────────────────────────────────────╮");
console.error("│ Error checking updates. Check the device connection │");
console.error("╰───────────────────────────────────────────────────────╯");
}
}

async function initializeMelon() {
const filteredArgs = ARGUMENTS.filter(x => x != "--ignore-update");

const melon = spawn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.9.0</Version>
<Version>3.0.0</Version>
<Description>Abstractions required to use and implement Melon.</Description>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 32a0e59

Please sign in to comment.