From 6e8727844309aa55f84e5c08ababee2726a46650 Mon Sep 17 00:00:00 2001 From: George Stagg Date: Tue, 23 Apr 2024 15:05:18 +0100 Subject: [PATCH] Set WEBR and WEBR_VERSION environment variables --- NEWS.md | 2 ++ src/webR/webr-main.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 5108b531..8f54a0d6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ * A `webR.version` property has been added, containing the current version and build information (#409). +* WebR now sets the environment variable `WEBR` equal to `"1"` and `WEBR_VERSION` equal to the webR version string in the WebAssembly environment (#414). + # webR 0.3.2 ## New features diff --git a/src/webR/webr-main.ts b/src/webR/webr-main.ts index 6058b5e9..bfb88b75 100644 --- a/src/webR/webr-main.ts +++ b/src/webR/webr-main.ts @@ -174,6 +174,8 @@ const defaultEnv = { FONTCONFIG_PATH: '/etc/fonts', R_HOME: '/usr/lib/R', R_ENABLE_JIT: '0', + WEBR: '1', + WEBR_VERSION: WEBR_VERSION, }; const defaultOptions = {