Deploying to gh-pages from @ m-lamonaca/json-to-env@1ab9291899 🚀

This commit is contained in:
m-lamonaca 2024-12-19 11:35:02 +00:00
commit 49ada1dd1f
14 changed files with 3892 additions and 0 deletions

245
artifacts.js Normal file
View file

@ -0,0 +1,245 @@
/* Code modified from the blender website
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
*/
let options = {
windows64: "x86_64-pc-windows",
windows32: "i686-pc-windows",
windowsArm: "aarch64-pc-windows",
mac64: "x86_64-apple",
mac32: "i686-apple",
macSilicon: "aarch64-apple",
linux64: "x86_64-unknown-linux",
linux32: "i686-unknown-linux",
linuxArm: "aarch64-unknown-linux",
// ios: "ios",
// android: "linux-android",
// freebsd: "freebsd",
};
function isAppleSilicon() {
try {
var glcontext = document.createElement("canvas").getContext("webgl");
var debugrenderer = glcontext
? glcontext.getExtension("WEBGL_debug_renderer_info")
: null;
var renderername =
(debugrenderer &&
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
"";
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
return true;
}
return false;
} catch (e) {}
}
function getOS() {
var OS = options.windows64.default;
var userAgent = navigator.userAgent;
var platform = navigator.platform;
if (navigator.appVersion.includes("Win")) {
if (
!userAgent.includes("Windows NT 5.0") &&
!userAgent.includes("Windows NT 5.1") &&
(userAgent.indexOf("Win64") > -1 ||
platform == "Win64" ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("amd64") > -1 ||
userAgent.indexOf("AMD64") > -1 ||
userAgent.indexOf("WOW64") > -1)
) {
OS = options.windows64;
} else {
if (
window.external &&
window.external.getHostEnvironmentValue &&
window.external
.getHostEnvironmentValue("os-architecture")
.includes("ARM64")
) {
OS = options.windowsArm;
} else {
try {
var canvas = document.createElement("canvas");
var gl = canvas.getContext("webgl");
var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
} catch (e) {}
}
}
}
//MacOS, MacOS X, macOS
if (navigator.appVersion.includes("Mac")) {
if (
navigator.userAgent.includes("OS X 10.5") ||
navigator.userAgent.includes("OS X 10.6")
) {
OS = options.mac32;
} else {
OS = options.mac64;
const isSilicon = isAppleSilicon();
if (isSilicon) {
OS = options.macSilicon;
}
}
}
// linux
if (platform.includes("Linux")) {
OS = options.linux64;
// FIXME: Can we find out whether linux 32-bit or ARM are used?
}
// if (
// userAgent.includes("iPad") ||
// userAgent.includes("iPhone") ||
// userAgent.includes("iPod")
// ) {
// OS = options.ios;
// }
// if (platform.toLocaleLowerCase().includes("freebsd")) {
// OS = options.freebsd;
// }
return OS;
}
let os = getOS();
window.os = os;
// Unhide and hydrate selector with events
const archSelect = document.querySelector(".arch-select");
if (archSelect) {
archSelect.classList.remove("hidden");
const selector = document.querySelector("#install-arch-select");
if (selector) {
selector.addEventListener("change", onArchChange);
}
}
// Hydrate tab buttons with events
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
tab.addEventListener("click", onTabClick);
});
function onArchChange(evt) {
// Get target
const target = evt.currentTarget.value;
// Find corresponding installer lists
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
// Hide old content element (if applicable)
if (oldContentEl) {
oldContentEl.classList.add("hidden");
}
// Show new content element
newContentEl.classList.remove("hidden");
// Show the first tab's content if nothing was selected before
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
}
// Hide "no OS detected" message
const noDetectEl = document.querySelector(".no-autodetect");
noDetectEl.classList.add("hidden");
// Hide Mac hint
document.querySelector(".mac-switch").classList.add("hidden");
}
function onTabClick(evt) {
// Get target and ID
const {triple, id} = evt.currentTarget.dataset;
if (triple) {
// Find corresponding content elements
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
// Find old tab to unselect
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
// Hide old content element
if (oldContentEl && oldTabEl) {
oldContentEl.classList.add("hidden");
oldTabEl.classList.remove("selected");
}
// Unhide new content element
newContentEl.classList.remove("hidden");
// Select new tab element
evt.currentTarget.classList.add("selected");
}
}
const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
let hit = allPlatforms.find(
(a) => {
// Show Intel Mac downloads if no M1 Mac downloads are available
if (
a.attributes["data-arch"].value.includes(options.mac64) &&
os.includes(options.macSilicon) &&
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
// Unhide hint
document.querySelector(".mac-switch").classList.remove("hidden");
return true;
}
return a.attributes["data-arch"].value.includes(os);
}
);
if (hit) {
hit.classList.remove("hidden");
const selectEl = document.querySelector("#install-arch-select");
selectEl.value = hit.dataset.arch;
const firstContentChild = hit.querySelector(".install-content:first-of-type");
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
} else {
const noDetectEl = document.querySelector(".no-autodetect");
if (noDetectEl) {
const noDetectElDetails = document.querySelector(".no-autodetect-details");
if (noDetectElDetails) {
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
}
noDetectEl.classList.remove("hidden");
}
}
let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
if (copyButtons.length) {
copyButtons.forEach(function (element) {
element.addEventListener("click", () => {
navigator.clipboard.writeText(element.attributes["data-copy"].value);
});
});
}
// Toggle for pre releases
const checkbox = document.getElementById("show-prereleases");
if (checkbox) {
checkbox.addEventListener("click", () => {
const all = document.getElementsByClassName("pre-release");
if (all) {
for (var item of all) {
item.classList.toggle("hidden");
}
}
});
}

1
artifacts.json Normal file

File diff suppressed because one or more lines are too long

299
artifacts/index.html Normal file
View file

@ -0,0 +1,299 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<div class="package-managers-downloads">
<div>
<h3>powershell</h3>
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">powershell</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">c </span><span style="color:#89ddff;">&quot;</span><span style="color:#c3e88d;">irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex</span><span style="color:#89ddff;">&quot;</span></pre>
<button class="button copy-clipboard-button primary" data-copy="powershell -c "irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex"">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.ps1.txt">Source</a>
</div>
</div>
<div>
<h3>shell</h3>
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</div>
</div>
<div>
<h3>Downloads</h3>
<table class="artifacts-table">
<tbody>
<tr>
<th>File</th>
<th>Platform</th>
<th>Checksum</th>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-apple-darwin.tar.xz">json2env-aarch64-apple-darwin.tar.xz</a></td>
<td>
macOS Apple Silicon
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-apple-darwin.tar.xz.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-pc-windows-msvc.zip">json2env-aarch64-pc-windows-msvc.zip</a></td>
<td>
Windows arm64
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-pc-windows-msvc.zip.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-unknown-linux-gnu.tar.xz">json2env-aarch64-unknown-linux-gnu.tar.xz</a></td>
<td>
Linux arm64
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-unknown-linux-gnu.tar.xz.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-apple-darwin.tar.xz">json2env-x86_64-apple-darwin.tar.xz</a></td>
<td>
macOS Intel
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-apple-darwin.tar.xz.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-pc-windows-msvc.zip">json2env-x86_64-pc-windows-msvc.zip</a></td>
<td>
Windows x64
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-pc-windows-msvc.zip.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-gnu.tar.xz">json2env-x86_64-unknown-linux-gnu.tar.xz</a></td>
<td>
Linux x64
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-gnu.tar.xz.sha256">checksum</a></td>
</tr>
<tr>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-musl.tar.xz">json2env-x86_64-unknown-linux-musl.tar.xz</a></td>
<td>
musl Linux x64
</td>
<td><a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-musl.tar.xz.sha256">checksum</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
<script src="/json-to-env/artifacts.js"></script>
</body>
</html>

1
changelog.rss Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>json2env Changelog</title><link>http://127.0.0.1:7979/json-to-env/changelog</link><description>Changelog information for json2env</description><category domain="https://github.com/m-lamonaca/json-to-env">json2env Changelog</category><atom:link href="http://127.0.0.1:7979/json-to-env/changelog.rss" rel="self"/><item><title>0.3.1</title><link>http://127.0.0.1:7979/json-to-env/changelog/0.3.1</link><category domain="https://github.com/m-lamonaca/json-to-env">json2env Changelog</category><guid>http://127.0.0.1:7979/json-to-env/changelog/0.3.1</guid><content:encoded><![CDATA[]]></content:encoded></item><item><title>0.3.0</title><link>http://127.0.0.1:7979/json-to-env/changelog/0.3.0</link><category domain="https://github.com/m-lamonaca/json-to-env">json2env Changelog</category><guid>http://127.0.0.1:7979/json-to-env/changelog/0.3.0</guid><content:encoded><![CDATA[]]></content:encoded></item><item><title>0.2.0</title><link>http://127.0.0.1:7979/json-to-env/changelog/0.2.0</link><category domain="https://github.com/m-lamonaca/json-to-env">json2env Changelog</category><guid>http://127.0.0.1:7979/json-to-env/changelog/0.2.0</guid><content:encoded><![CDATA[]]></content:encoded></item><item><title>v0.1.0</title><link>http://127.0.0.1:7979/json-to-env/changelog/v0.1.0</link><category domain="https://github.com/m-lamonaca/json-to-env">json2env Changelog</category><guid>http://127.0.0.1:7979/json-to-env/changelog/v0.1.0</guid><content:encoded><![CDATA[]]></content:encoded></item></channel></rss>

111
changelog/0.2.0/index.html Normal file
View file

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<h1>0.2.0</h1>
<div class="releases-body">
<section class="release ">
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.2.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Mar 9 2024 at 10:42 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
</body>
</html>

111
changelog/0.3.0/index.html Normal file
View file

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<h1>0.3.0</h1>
<div class="releases-body">
<section class="release ">
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.3.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Nov 8 2024 at 11:41 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
</body>
</html>

111
changelog/0.3.1/index.html Normal file
View file

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<h1>0.3.1</h1>
<div class="releases-body">
<section class="release ">
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.3.1
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Dec 19 2024 at 11:34 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
</body>
</html>

239
changelog/index.html Normal file
View file

@ -0,0 +1,239 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<h1>
Releases
<a href="/json-to-env/changelog.rss" class="inline-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path d="M3.75 3a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75H4c6.075 0 11 4.925 11 11v.25c0 .414.336.75.75.75h.5a.75.75 0 00.75-.75V16C17 8.82 11.18 3 4 3h-.25z" />
<path d="M3 8.75A.75.75 0 013.75 8H4a8 8 0 018 8v.25a.75.75 0 01-.75.75h-.5a.75.75 0 01-.75-.75V16a6 6 0 00-6-6h-.25A.75.75 0 013 9.25v-.5zM7 15a2 2 0 11-4 0 2 2 0 014 0z" />
</svg></a>
</h1>
<div class="releases-wrapper">
<nav class="releases-nav">
<ul>
<li class="">
<a href="0.3.1/">0.3.1</a>
</li>
<li class="">
<a href="0.3.0/">0.3.0</a>
</li>
<li class="">
<a href="0.2.0/">0.2.0</a>
</li>
<li class="">
<a href="v0.1.0/">v0.1.0</a>
</li>
</ul>
</nav>
<div class="releases-list">
<section class="release ">
<h2 id="tag-0.3.1">
<a href="0.3.1/">
0.3.1
</a>
</h2>
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.3.1
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Dec 19 2024 at 11:34 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
<section class="release ">
<h2 id="tag-0.3.0">
<a href="0.3.0/">
0.3.0
</a>
</h2>
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.3.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Nov 8 2024 at 11:41 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
<section class="release ">
<h2 id="tag-0.2.0">
<a href="0.2.0/">
0.2.0
</a>
</h2>
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
0.2.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Mar 9 2024 at 10:42 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
<section class="release ">
<h2 id="tag-v0.1.0">
<a href="v0.1.0/">
v0.1.0
</a>
</h2>
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
v0.1.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Jun 28 2023 at 22:00 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
</div>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
<script src="/json-to-env/artifacts.js"></script>
</body>
</html>

111
changelog/v0.1.0/index.html Normal file
View file

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div>
<h1>v0.1.0</h1>
<div class="releases-body">
<section class="release ">
<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
v0.1.0
</span>
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Jun 28 2023 at 22:00 UTC
</span>
</div>
<div class="release-body">
</div>
</section>
</div>
</div>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
</body>
</html>

BIN
favicon.ico Normal file

Binary file not shown.

After

Width: 48px  |  Height: 48px  |  Size: 15 KiB

656
index.html Normal file
View file

@ -0,0 +1,656 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="hacker">
<head>
<title>json2env</title>
<link rel="icon" href="/json-to-env/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JSON to Env Var converter" />
<meta property="og:description" content="JSON to Env Var converter" />
<meta property="og:type" content="website" />
<meta property="og:title" content="json2env" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/json-to-env/oranda-v0.6.1.css" />
</head>
<body>
<div class="container">
<div class="page-body">
<div class="repo_banner">
<a href="https://github.com/m-lamonaca/json-to-env">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>
<main>
<header>
<h1 class="title">json2env</h1>
<nav class="nav">
<ul>
<li><a href="/json-to-env/">Home</a></li>
<li><a href="/json-to-env/artifacts/">Install</a></li>
<li><a href="/json-to-env/changelog/">Changelog</a></li>
</ul>
</nav>
</header>
<div class="artifacts" data-tag="0.3.1">
<div class="artifact-header target">
<h4>Install 0.3.1</h4>
<div><small class="published-date">Published on Dec 19 2024 at 11:34 UTC</small></div>
<ul class="arches">
<li class="arch hidden" data-arch="aarch64-apple-darwin">
<ul class="tabs">
<li class="install-tab" data-id="8" data-triple="aarch64-apple-darwin">
shell
</li>
<li class="install-tab" data-id="0" data-triple="aarch64-apple-darwin">
tarball
</li>
</ul>
<ul class="contents">
<li data-id="8" data-triple="aarch64-apple-darwin" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</li>
<li data-id="0" data-triple="aarch64-apple-darwin" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-apple-darwin.tar.xz">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-aarch64-apple-darwin.tar.xz</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="aarch64-pc-windows-msvc">
<ul class="tabs">
<li class="install-tab" data-id="7" data-triple="aarch64-pc-windows-msvc">
powershell
</li>
<li class="install-tab" data-id="1" data-triple="aarch64-pc-windows-msvc">
zip
</li>
</ul>
<ul class="contents">
<li data-id="7" data-triple="aarch64-pc-windows-msvc" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">powershell</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">c </span><span style="color:#89ddff;">&quot;</span><span style="color:#c3e88d;">irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex</span><span style="color:#89ddff;">&quot;</span></pre>
<button class="button copy-clipboard-button primary" data-copy="powershell -c "irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex"">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.ps1.txt">Source</a>
</div>
</li>
<li data-id="1" data-triple="aarch64-pc-windows-msvc" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-pc-windows-msvc.zip">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-aarch64-pc-windows-msvc.zip</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="aarch64-unknown-linux-gnu">
<ul class="tabs">
<li class="install-tab" data-id="8" data-triple="aarch64-unknown-linux-gnu">
shell
</li>
<li class="install-tab" data-id="2" data-triple="aarch64-unknown-linux-gnu">
tarball
</li>
</ul>
<ul class="contents">
<li data-id="8" data-triple="aarch64-unknown-linux-gnu" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</li>
<li data-id="2" data-triple="aarch64-unknown-linux-gnu" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-aarch64-unknown-linux-gnu.tar.xz">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-aarch64-unknown-linux-gnu.tar.xz</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="x86_64-apple-darwin">
<ul class="tabs">
<li class="install-tab" data-id="8" data-triple="x86_64-apple-darwin">
shell
</li>
<li class="install-tab" data-id="3" data-triple="x86_64-apple-darwin">
tarball
</li>
</ul>
<ul class="contents">
<li data-id="8" data-triple="x86_64-apple-darwin" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</li>
<li data-id="3" data-triple="x86_64-apple-darwin" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-apple-darwin.tar.xz">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-x86_64-apple-darwin.tar.xz</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="x86_64-pc-windows-msvc">
<ul class="tabs">
<li class="install-tab" data-id="7" data-triple="x86_64-pc-windows-msvc">
powershell
</li>
<li class="install-tab" data-id="4" data-triple="x86_64-pc-windows-msvc">
zip
</li>
</ul>
<ul class="contents">
<li data-id="7" data-triple="x86_64-pc-windows-msvc" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">powershell</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">c </span><span style="color:#89ddff;">&quot;</span><span style="color:#c3e88d;">irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex</span><span style="color:#89ddff;">&quot;</span></pre>
<button class="button copy-clipboard-button primary" data-copy="powershell -c "irm https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.ps1 | iex"">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.ps1.txt">Source</a>
</div>
</li>
<li data-id="4" data-triple="x86_64-pc-windows-msvc" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-pc-windows-msvc.zip">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-x86_64-pc-windows-msvc.zip</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="x86_64-unknown-linux-gnu">
<ul class="tabs">
<li class="install-tab" data-id="8" data-triple="x86_64-unknown-linux-gnu">
shell
</li>
<li class="install-tab" data-id="5" data-triple="x86_64-unknown-linux-gnu">
tarball
</li>
</ul>
<ul class="contents">
<li data-id="8" data-triple="x86_64-unknown-linux-gnu" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</li>
<li data-id="5" data-triple="x86_64-unknown-linux-gnu" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-gnu.tar.xz">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-x86_64-unknown-linux-gnu.tar.xz</span>
</button>
</a>
</div>
</li>
</ul>
</li>
<li class="arch hidden" data-arch="x86_64-unknown-linux-musl">
<ul class="tabs">
<li class="install-tab" data-id="8" data-triple="x86_64-unknown-linux-musl">
shell
</li>
<li class="install-tab" data-id="6" data-triple="x86_64-unknown-linux-musl">
tarball
</li>
</ul>
<ul class="contents">
<li data-id="8" data-triple="x86_64-unknown-linux-musl" class="install-content">
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">&#39;</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">&#39; --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-installer.sh | sh">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>
<a class="button primary" href="/json-to-env/json2env-installer.sh.txt">Source</a>
</div>
</li>
<li data-id="6" data-triple="x86_64-unknown-linux-musl" class="install-content hidden">
<div class="download-wrapper">
<a href="https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1/json2env-x86_64-unknown-linux-musl.tar.xz">
<button class="button primary">
<span>Download</span>
<span class="button-subtitle">json2env-x86_64-unknown-linux-musl.tar.xz</span>
</button>
</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="no-autodetect hidden">
<span class="no-autodetect-details">We weren't able to detect your OS.</span>
</div>
<noscript>
<a href="/json-to-env/artifacts/">View all installation options</a>
</noscript>
<div class="mac-switch hidden">This project doesn't offer Apple Silicon downloads, but you can run Intel macOS binaries via Rosetta 2.</div>
<div class="bottom-options ">
<a href="/json-to-env/artifacts/" class="backup-download primary">View all installation options</a>
<div class="arch-select hidden">
<select id="install-arch-select">
<option disabled="true" selected="true" value=""></option>
<option value="aarch64-unknown-linux-gnu">Linux arm64</option>
<option value="x86_64-unknown-linux-gnu">Linux x64</option>
<option value="aarch64-apple-darwin">macOS Apple Silicon</option>
<option value="x86_64-apple-darwin">macOS Intel</option>
<option value="x86_64-unknown-linux-musl">musl Linux x64</option>
<option value="aarch64-pc-windows-msvc">Windows arm64</option>
<option value="x86_64-pc-windows-msvc">Windows x64</option>
</select>
</div>
</div>
</div>
<a href="/json-to-env/artifacts/" class="button mobile-download primary">View all installation options</a>
<h1>json2env</h1>
<p>Convert valid JSON to environment variables or an <code>.env</code>-line file.</p>
<h2>Usage</h2>
<pre style="background-color:#263238;"><span style="color:#82aaff;">JSON to Env Var converter
</span><span style="color:#eeffff;">
</span><span style="color:#82aaff;">Usage: json2env.exe </span><span style="font-style:italic;color:#c792ea;">[</span><span style="color:#82aaff;">OPTIONS</span><span style="font-style:italic;color:#c792ea;">]
</span><span style="color:#eeffff;">
</span><span style="color:#82aaff;">Options:
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-i,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">input </span><span style="color:#89ddff;">&lt;</span><span style="color:#82aaff;">FILE</span><span style="color:#89ddff;">&gt;</span><span style="color:#82aaff;"> Input file, defaults to STDIN if not specified
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-o,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">output </span><span style="color:#89ddff;">&lt;</span><span style="color:#82aaff;">FILE</span><span style="color:#89ddff;">&gt;</span><span style="color:#82aaff;"> Output file, defaults to STDOUT if not specified
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-s,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">key-separator </span><span style="color:#89ddff;">&lt;</span><span style="color:#82aaff;">STRING</span><span style="color:#89ddff;">&gt;</span><span style="color:#82aaff;"> Separator for nested keys </span><span style="font-style:italic;color:#c792ea;">[</span><span style="color:#82aaff;">default: __</span><span style="font-style:italic;color:#c792ea;">]
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-S,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">array-separator </span><span style="color:#89ddff;">&lt;</span><span style="color:#82aaff;">STRING</span><span style="color:#89ddff;">&gt;</span><span style="color:#82aaff;"> Separator for array elements </span><span style="font-style:italic;color:#c792ea;">[</span><span style="color:#82aaff;">default: ,</span><span style="font-style:italic;color:#c792ea;">]
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-e,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">enumerate-array</span><span style="color:#82aaff;"> Separate array elements in multiple environment variables
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-h,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">help</span><span style="color:#82aaff;"> Print help
</span><span style="color:#eeffff;"> </span><span style="color:#82aaff;">-V,</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">version</span><span style="color:#82aaff;"> Print version
</span></pre>
</main>
</div>
<footer>
<a href="https://github.com/m-lamonaca/json-to-env"><div class="github-icon" aria-hidden="true"></div></a>
<span>
json2env, MIT
</span>
</footer>
</div>
<script src="/json-to-env/artifacts.js"></script>
</body>
</html>

562
json2env-installer.ps1.txt Normal file
View file

@ -0,0 +1,562 @@
# Licensed under the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
<#
.SYNOPSIS
The installer for json2env 0.3.1
.DESCRIPTION
This script detects what platform you're on and fetches an appropriate archive from
https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1
then unpacks the binaries and installs them to
$env:CARGO_HOME/bin (or $HOME/.cargo/bin)
It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from
.PARAMETER NoModifyPath
Don't add the install directory to PATH
.PARAMETER Help
Print help
#>
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/m-lamonaca/json-to-env/releases/download/0.3.1',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
$app_name = 'json2env'
$app_version = '0.3.1'
if ($env:JSON2ENV_INSTALLER_GHE_BASE_URL) {
$installer_base_url = $env:JSON2ENV_INSTALLER_GHE_BASE_URL
} elseif ($env:JSON2ENV_INSTALLER_GITHUB_BASE_URL) {
$installer_base_url = $env:JSON2ENV_INSTALLER_GITHUB_BASE_URL
} else {
$installer_base_url = "https://github.com"
}
if ($env:INSTALLER_DOWNLOAD_URL) {
$ArtifactDownloadUrl = $env:INSTALLER_DOWNLOAD_URL
} else {
$ArtifactDownloadUrl = "$installer_base_url/m-lamonaca/json-to-env/releases/download/0.3.1"
}
$receipt = @"
{"binaries":["CARGO_DIST_BINS"],"binary_aliases":{},"cdylibs":["CARGO_DIST_DYLIBS"],"cstaticlibs":["CARGO_DIST_STATICLIBS"],"install_layout":"unspecified","install_prefix":"AXO_INSTALL_PREFIX","modify_path":true,"provider":{"source":"cargo-dist","version":"0.26.1"},"source":{"app_name":"json2env","name":"json-to-env","owner":"m-lamonaca","release_type":"github"},"version":"0.3.1"}
"@
$receipt_home = "${env:LOCALAPPDATA}\json2env"
if ($env:JSON2ENV_DISABLE_UPDATE) {
$install_updater = $false
} else {
$install_updater = $true
}
if ($NoModifyPath) {
Write-Information "-NoModifyPath has been deprecated; please set JSON2ENV_NO_MODIFY_PATH=1 in the environment"
}
if ($env:JSON2ENV_NO_MODIFY_PATH) {
$NoModifyPath = $true
}
$unmanaged_install = $env:JSON2ENV_UNMANAGED_INSTALL
if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
}
function Install-Binary($install_args) {
if ($Help) {
Get-Help $PSCommandPath -Detailed
Exit
}
Initialize-Environment
# Platform info injected by dist
$platforms = @{
"aarch64-pc-windows-gnu" = @{
"artifact_name" = "json2env-aarch64-pc-windows-msvc.zip"
"bins" = @("json2env.exe")
"libs" = @()
"staticlibs" = @()
"zip_ext" = ".zip"
"aliases" = @{
}
"aliases_json" = '{}'
}
"aarch64-pc-windows-msvc" = @{
"artifact_name" = "json2env-aarch64-pc-windows-msvc.zip"
"bins" = @("json2env.exe")
"libs" = @()
"staticlibs" = @()
"zip_ext" = ".zip"
"aliases" = @{
}
"aliases_json" = '{}'
}
"x86_64-pc-windows-gnu" = @{
"artifact_name" = "json2env-x86_64-pc-windows-msvc.zip"
"bins" = @("json2env.exe")
"libs" = @()
"staticlibs" = @()
"zip_ext" = ".zip"
"aliases" = @{
}
"aliases_json" = '{}'
}
"x86_64-pc-windows-msvc" = @{
"artifact_name" = "json2env-x86_64-pc-windows-msvc.zip"
"bins" = @("json2env.exe")
"libs" = @()
"staticlibs" = @()
"zip_ext" = ".zip"
"aliases" = @{
}
"aliases_json" = '{}'
}
}
$fetched = Download "$ArtifactDownloadUrl" $platforms
# FIXME: add a flag that lets the user not do this step
try {
Invoke-Installer -artifacts $fetched -platforms $platforms "$install_args"
} catch {
throw @"
We encountered an error trying to perform the installation;
please review the error messages below.
$_
"@
}
}
function Get-TargetTriple($platforms) {
$double = Get-Arch
if ($platforms.Contains("$double-msvc")) {
return "$double-msvc"
} else {
return "$double-gnu"
}
}
function Get-Arch() {
try {
# NOTE: this might return X64 on ARM64 Windows, which is OK since emulation is available.
# It works correctly starting in PowerShell Core 7.3 and Windows PowerShell in Win 11 22H2.
# Ideally this would just be
# [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
# but that gets a type from the wrong assembly on Windows PowerShell (i.e. not Core)
$a = [System.Reflection.Assembly]::LoadWithPartialName("System.Runtime.InteropServices.RuntimeInformation")
$t = $a.GetType("System.Runtime.InteropServices.RuntimeInformation")
$p = $t.GetProperty("OSArchitecture")
# Possible OSArchitecture Values: https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.architecture
# Rust supported platforms: https://doc.rust-lang.org/stable/rustc/platform-support.html
switch ($p.GetValue($null).ToString())
{
"X86" { return "i686-pc-windows" }
"X64" { return "x86_64-pc-windows" }
"Arm" { return "thumbv7a-pc-windows" }
"Arm64" { return "aarch64-pc-windows" }
}
} catch {
# The above was added in .NET 4.7.1, so Windows PowerShell in versions of Windows
# prior to Windows 10 v1709 may not have this API.
Write-Verbose "Get-TargetTriple: Exception when trying to determine OS architecture."
Write-Verbose $_
}
# This is available in .NET 4.0. We already checked for PS 5, which requires .NET 4.5.
Write-Verbose("Get-TargetTriple: falling back to Is64BitOperatingSystem.")
if ([System.Environment]::Is64BitOperatingSystem) {
return "x86_64-pc-windows"
} else {
return "i686-pc-windows"
}
}
function Download($download_url, $platforms) {
$arch = Get-TargetTriple $platforms
if (-not $platforms.ContainsKey($arch)) {
$platforms_json = ConvertTo-Json $platforms
throw "ERROR: could not find binaries for this platform. Last platform tried: $arch platform info: $platforms_json"
}
# Lookup what we expect this platform to look like
$info = $platforms[$arch]
$zip_ext = $info["zip_ext"]
$bin_names = $info["bins"]
$lib_names = $info["libs"]
$staticlib_names = $info["staticlibs"]
$artifact_name = $info["artifact_name"]
# Make a new temp dir to unpack things to
$tmp = New-Temp-Dir
$dir_path = "$tmp\$app_name$zip_ext"
# Download and unpack!
$url = "$download_url/$artifact_name"
Write-Information "Downloading $app_name $app_version ($arch)"
Write-Verbose " from $url"
Write-Verbose " to $dir_path"
$wc = New-Object Net.Webclient
$wc.downloadFile($url, $dir_path)
Write-Verbose "Unpacking to $tmp"
# Select the tool to unpack the files with.
#
# As of windows 10(?), powershell comes with tar preinstalled, but in practice
# it only seems to support .tar.gz, and not xz/zstd. Still, we should try to
# forward all tars to it in case the user has a machine that can handle it!
switch -Wildcard ($zip_ext) {
".zip" {
Expand-Archive -Path $dir_path -DestinationPath "$tmp";
Break
}
".tar.*" {
tar xf $dir_path --strip-components 1 -C "$tmp";
Break
}
Default {
throw "ERROR: unknown archive format $zip_ext"
}
}
# Let the next step know what to copy
$bin_paths = @()
foreach ($bin_name in $bin_names) {
Write-Verbose " Unpacked $bin_name"
$bin_paths += "$tmp\$bin_name"
}
$lib_paths = @()
foreach ($lib_name in $lib_names) {
Write-Verbose " Unpacked $lib_name"
$lib_paths += "$tmp\$lib_name"
}
$staticlib_paths = @()
foreach ($lib_name in $staticlib_names) {
Write-Verbose " Unpacked $lib_name"
$staticlib_paths += "$tmp\$lib_name"
}
if (($null -ne $info["updater"]) -and $install_updater) {
$updater_id = $info["updater"]["artifact_name"]
$updater_url = "$download_url/$updater_id"
$out_name = "$tmp\json2env-update.exe"
$wc.downloadFile($updater_url, $out_name)
$bin_paths += $out_name
}
return @{
"bin_paths" = $bin_paths
"lib_paths" = $lib_paths
"staticlib_paths" = $staticlib_paths
}
}
function Invoke-Installer($artifacts, $platforms) {
# Replaces the placeholder binary entry with the actual list of binaries
$arch = Get-TargetTriple $platforms
if (-not $platforms.ContainsKey($arch)) {
$platforms_json = ConvertTo-Json $platforms
throw "ERROR: could not find binaries for this platform. Last platform tried: $arch platform info: $platforms_json"
}
$info = $platforms[$arch]
# Forces the install to occur at this path, not the default
$force_install_dir = $null
$install_layout = "unspecified"
# Check the newer app-specific variable before falling back
# to the older generic one
if (($env:JSON2ENV_INSTALL_DIR)) {
$force_install_dir = $env:JSON2ENV_INSTALL_DIR
$install_layout = "cargo-home"
} elseif (($env:CARGO_DIST_FORCE_INSTALL_DIR)) {
$force_install_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR
$install_layout = "cargo-home"
} elseif ($unmanaged_install) {
$force_install_dir = $unmanaged_install
$install_layout = "flat"
}
# Check if the install layout should be changed from `flat` to `cargo-home`
# for backwards compatible updates of applications that switched layouts.
if (($force_install_dir) -and ($install_layout -eq "flat")) {
# If the install directory is targeting the Cargo home directory, then
# we assume this application was previously installed that layout
# Note the installer passes the path with `\\` separators, but here they are
# `\` so we normalize for comparison. We don't use `Resolve-Path` because they
# may not exist.
$cargo_home = if ($env:CARGO_HOME) { $env:CARGO_HOME } else {
Join-Path $(if ($HOME) { $HOME } else { "." }) ".cargo"
}
if ($force_install_dir.Replace('\\', '\') -eq $cargo_home) {
$install_layout = "cargo-home"
}
}
# The actual path we're going to install to
$dest_dir = $null
$dest_dir_lib = $null
# The install prefix we write to the receipt.
# For organized install methods like CargoHome, which have
# subdirectories, this is the root without `/bin`. For other
# methods, this is the same as `_install_dir`.
$receipt_dest_dir = $null
# Before actually consulting the configured install strategy, see
# if we're overriding it.
if (($force_install_dir)) {
switch ($install_layout) {
"hierarchical" {
$dest_dir = Join-Path $force_install_dir "bin"
$dest_dir_lib = Join-Path $force_install_dir "lib"
}
"cargo-home" {
$dest_dir = Join-Path $force_install_dir "bin"
$dest_dir_lib = $dest_dir
}
"flat" {
$dest_dir = $force_install_dir
$dest_dir_lib = $dest_dir
}
Default {
throw "Error: unrecognized installation layout: $install_layout"
}
}
$receipt_dest_dir = $force_install_dir
}
if (-Not $dest_dir) {
# first try $env:CARGO_HOME, then fallback to $HOME
# (for whatever reason $HOME is not a normal env var and doesn't need the $env: prefix)
$root = if (($base_dir = $env:CARGO_HOME)) {
$base_dir
} elseif (($base_dir = $HOME)) {
Join-Path $base_dir ".cargo"
} else {
throw "ERROR: could not find your HOME dir or CARGO_HOME to install binaries to"
}
$dest_dir = Join-Path $root "bin"
$dest_dir_lib = $dest_dir
$receipt_dest_dir = $root
$install_layout = "cargo-home"
}
# Looks like all of the above assignments failed
if (-Not $dest_dir) {
throw "ERROR: could not find a valid path to install to; please check the installation instructions"
}
# The replace call here ensures proper escaping is inlined into the receipt
$receipt = $receipt.Replace('AXO_INSTALL_PREFIX', $receipt_dest_dir.replace("\", "\\"))
$receipt = $receipt.Replace('"install_layout":"unspecified"', -join('"install_layout":"', $install_layout, '"'))
$dest_dir = New-Item -Force -ItemType Directory -Path $dest_dir
$dest_dir_lib = New-Item -Force -ItemType Directory -Path $dest_dir_lib
Write-Information "Installing to $dest_dir"
# Just copy the binaries from the temp location to the install dir
foreach ($bin_path in $artifacts["bin_paths"]) {
$installed_file = Split-Path -Path "$bin_path" -Leaf
Copy-Item "$bin_path" -Destination "$dest_dir" -ErrorAction Stop
Remove-Item "$bin_path" -Recurse -Force -ErrorAction Stop
Write-Information " $installed_file"
if (($dests = $info["aliases"][$installed_file])) {
$source = Join-Path "$dest_dir" "$installed_file"
foreach ($dest_name in $dests) {
$dest = Join-Path $dest_dir $dest_name
$null = New-Item -ItemType HardLink -Target "$source" -Path "$dest" -Force -ErrorAction Stop
}
}
}
foreach ($lib_path in $artifacts["lib_paths"]) {
$installed_file = Split-Path -Path "$lib_path" -Leaf
Copy-Item "$lib_path" -Destination "$dest_dir_lib" -ErrorAction Stop
Remove-Item "$lib_path" -Recurse -Force -ErrorAction Stop
Write-Information " $installed_file"
}
foreach ($lib_path in $artifacts["staticlib_paths"]) {
$installed_file = Split-Path -Path "$lib_path" -Leaf
Copy-Item "$lib_path" -Destination "$dest_dir_lib" -ErrorAction Stop
Remove-Item "$lib_path" -Recurse -Force -ErrorAction Stop
Write-Information " $installed_file"
}
$formatted_bins = ($info["bins"] | ForEach-Object { '"' + $_ + '"' }) -join ","
$receipt = $receipt.Replace('"CARGO_DIST_BINS"', $formatted_bins)
$formatted_libs = ($info["libs"] | ForEach-Object { '"' + $_ + '"' }) -join ","
$receipt = $receipt.Replace('"CARGO_DIST_DYLIBS"', $formatted_libs)
$formatted_staticlibs = ($info["staticlibs"] | ForEach-Object { '"' + $_ + '"' }) -join ","
$receipt = $receipt.Replace('"CARGO_DIST_STATICLIBS"', $formatted_staticlibs)
# Also replace the aliases with the arch-specific one
$receipt = $receipt.Replace('"binary_aliases":{}', -join('"binary_aliases":', $info['aliases_json']))
if ($NoModifyPath) {
$receipt = $receipt.Replace('"modify_path":true', '"modify_path":false')
}
# Write the install receipt
if ($install_updater) {
$null = New-Item -Path $receipt_home -ItemType "directory" -ErrorAction SilentlyContinue
# Trying to get Powershell 5.1 (not 6+, which is fake and lies) to write utf8 is a crime
# because "Out-File -Encoding utf8" actually still means utf8BOM, so we need to pull out
# .NET's APIs which actually do what you tell them (also apparently utf8NoBOM is the
# default in newer .NETs but I'd rather not rely on that at this point).
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[IO.File]::WriteAllLines("$receipt_home/json2env-receipt.json", "$receipt", $Utf8NoBomEncoding)
}
# Respect the environment, but CLI takes precedence
if ($null -eq $NoModifyPath) {
$NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH
}
Write-Information "everything's installed!"
if (-not $NoModifyPath) {
Add-Ci-Path $dest_dir
if (Add-Path $dest_dir) {
Write-Information ""
Write-Information "To add $dest_dir to your PATH, either restart your system or run:"
Write-Information ""
Write-Information " set Path=$dest_dir;%Path% (cmd)"
Write-Information " `$env:Path = `"$dest_dir;`$env:Path`" (powershell)"
}
}
}
# Attempt to do CI-specific rituals to get the install-dir on PATH faster
function Add-Ci-Path($OrigPathToAdd) {
# If GITHUB_PATH is present, then write install_dir to the file it refs.
# After each GitHub Action, the contents will be added to PATH.
# So if you put a curl | sh for this script in its own "run" step,
# the next step will have this dir on PATH.
#
# Note that GITHUB_PATH will not resolve any variables, so we in fact
# want to write the install dir and not an expression that evals to it
if (($gh_path = $env:GITHUB_PATH)) {
Write-Output "$OrigPathToAdd" | Out-File -FilePath "$gh_path" -Encoding utf8 -Append
}
}
# Try to add the given path to PATH via the registry
#
# Returns true if the registry was modified, otherwise returns false
# (indicating it was already on PATH)
function Add-Path($OrigPathToAdd) {
Write-Verbose "Adding $OrigPathToAdd to your PATH"
$RegistryPath = "HKCU:\Environment"
$PropertyName = "Path"
$PathToAdd = $OrigPathToAdd
$Item = if (Test-Path $RegistryPath) {
# If the registry key exists, get it
Get-Item -Path $RegistryPath
} else {
# If the registry key doesn't exist, create it
Write-Verbose "Creating $RegistryPath"
New-Item -Path $RegistryPath -Force
}
$OldPath = ""
try {
# Try to get the old PATH value. If that fails, assume we're making it from scratch.
# Otherwise assume there's already paths in here and use a ; separator
$OldPath = $Item | Get-ItemPropertyValue -Name $PropertyName
$PathToAdd = "$PathToAdd;"
} catch {
# We'll be creating the PATH from scratch
Write-Verbose "No $PropertyName Property exists on $RegistryPath (we'll make one)"
}
# Check if the path is already there
#
# We don't want to incorrectly match "C:\blah\" to "C:\blah\blah\", so we include the semicolon
# delimiters when searching, ensuring exact matches. To avoid corner cases we add semicolons to
# both sides of the input, allowing us to pretend we're always in the middle of a list.
Write-Verbose "Old $PropertyName Property is $OldPath"
if (";$OldPath;" -like "*;$OrigPathToAdd;*") {
# Already on path, nothing to do
Write-Verbose "install dir already on PATH, all done!"
return $false
} else {
# Actually update PATH
Write-Verbose "Actually mutating $PropertyName Property"
$NewPath = $PathToAdd + $OldPath
# We use -Force here to make the value already existing not be an error
$Item | New-ItemProperty -Name $PropertyName -Value $NewPath -PropertyType String -Force | Out-Null
return $true
}
}
function Initialize-Environment() {
If (($PSVersionTable.PSVersion.Major) -lt 5) {
throw @"
Error: PowerShell 5 or later is required to install $app_name.
Upgrade PowerShell:
https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell
"@
}
# show notification to change execution policy:
$allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass')
If ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) {
throw @"
Error: PowerShell requires an execution policy in [$($allowedExecutionPolicy -join ", ")] to run $app_name. For example, to set the execution policy to 'RemoteSigned' please run:
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
"@
}
# GitHub requires TLS 1.2
If ([System.Enum]::GetNames([System.Net.SecurityProtocolType]) -notcontains 'Tls12') {
throw @"
Error: Installing $app_name requires at least .NET Framework 4.5
Please download and install it first:
https://www.microsoft.com/net/download
"@
}
}
function New-Temp-Dir() {
[CmdletBinding(SupportsShouldProcess)]
param()
$parent = [System.IO.Path]::GetTempPath()
[string] $name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name)
}
# PSScriptAnalyzer doesn't like how we use our params as globals, this calms it
$Null = $ArtifactDownloadUrl, $NoModifyPath, $Help
# Make Write-Information statements be visible
$InformationPreference = "Continue"
# The default interactive handler
try {
Install-Binary "$Args"
} catch {
Write-Information $_
exit 1
}

1442
json2env-installer.sh.txt Normal file

File diff suppressed because it is too large Load diff

3
oranda-v0.6.1.css Normal file

File diff suppressed because one or more lines are too long