Bump version to 2.5.1 and support plain root installs

This commit is contained in:
Renan Castro
2021-11-04 11:33:08 -03:00
committed by filipenevola
parent 7a614698ed
commit 2be7585937
3 changed files with 18 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
const path = require('path');
const os = require('os');
const METEOR_LATEST_VERSION = '2.5';
const METEOR_LATEST_VERSION = '2.5.1';
const sudoUser = process.env.SUDO_USER || '';
function isRoot() {
return process.getuid && process.getuid() === 0;
@@ -9,9 +9,20 @@ function isRoot() {
const localAppData = process.env.LOCALAPPDATA;
const isWindows = () => os.platform() === 'win32';
const isMac = () => os.platform() === 'darwin';
const rootPath = isWindows()
? localAppData
: `${isRoot() ? `/home/${sudoUser}` : os.homedir()}`;
let rootPath;
if (isWindows()) {
rootPath = localAppData;
} else if (isRoot() && sudoUser) {
rootPath = `/home/${sudoUser}`;
} else {
if (isRoot()) {
console.info(
'You are running the install script as root, without SUDO. This is not recommended and should be avoided. Continuing.'
);
}
rootPath = os.homedir();
}
if (isWindows() && !localAppData) {
throw new Error('LOCALAPPDATA env var is not set.');

View File

@@ -31,7 +31,6 @@ const semver = require('semver')
process.on('unhandledRejection', err => {
throw err;
});
if (os.arch() !== 'x64') {
const isValidM1Version = semver.gte(METEOR_LATEST_VERSION, '2.5.1');
if(os.arch() !== 'arm64' || !isMac() || !isValidM1Version){
@@ -246,8 +245,6 @@ function showGettingStarted() {
Meteor has been installed!
*You might need to open a new terminal windows to have access to the meteor command.*
To get started fast:
$ meteor create ~/my_cool_app
@@ -262,6 +259,8 @@ Deploy and host your app with Cloud:
www.meteor.com/cloud
***************************************
*You need to open a new terminal window to have access to the meteor command.*
***************************************
`;

View File

@@ -1,6 +1,6 @@
{
"name": "meteor",
"version": "2.5.0",
"version": "2.5.1",
"description": "Install Meteor on Windows",
"main": "install.js",
"scripts": {