mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-18 06:39:28 +00:00
Prevent overwriting existing libraries and platforms at first IDE start-up (#1169)
* move initialization of libs and platforms into new contribution * use noOverwrite when install built-in libraries and platform * catch errors when installing platforms and libraries at first start-up * arduino-cli version 0.25.0-rc1 * refine platforms and libraries initialization in case of errors * add trailing newline when libraries and platform installation fail * use regex to check error if builtin library dependencies are already installed * rename contribution
This commit is contained in:
committed by
GitHub
parent
46fcc71dd8
commit
73835eced3
@@ -95,6 +95,9 @@ export class CompileRequest extends jspb.Message {
|
||||
getEncryptKey(): string;
|
||||
setEncryptKey(value: string): CompileRequest;
|
||||
|
||||
getSkipLibrariesDiscovery(): boolean;
|
||||
setSkipLibrariesDiscovery(value: boolean): CompileRequest;
|
||||
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileRequest.AsObject;
|
||||
@@ -133,6 +136,7 @@ export namespace CompileRequest {
|
||||
keysKeychain: string,
|
||||
signKey: string,
|
||||
encryptKey: string,
|
||||
skipLibrariesDiscovery: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,8 @@ proto.cc.arduino.cli.commands.v1.CompileRequest.toObject = function(includeInsta
|
||||
libraryList: (f = jspb.Message.getRepeatedField(msg, 24)) == null ? undefined : f,
|
||||
keysKeychain: jspb.Message.getFieldWithDefault(msg, 25, ""),
|
||||
signKey: jspb.Message.getFieldWithDefault(msg, 26, ""),
|
||||
encryptKey: jspb.Message.getFieldWithDefault(msg, 27, "")
|
||||
encryptKey: jspb.Message.getFieldWithDefault(msg, 27, ""),
|
||||
skipLibrariesDiscovery: jspb.Message.getBooleanFieldWithDefault(msg, 28, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -286,6 +287,10 @@ proto.cc.arduino.cli.commands.v1.CompileRequest.deserializeBinaryFromReader = fu
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setEncryptKey(value);
|
||||
break;
|
||||
case 28:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setSkipLibrariesDiscovery(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -482,6 +487,13 @@ proto.cc.arduino.cli.commands.v1.CompileRequest.serializeBinaryToWriter = functi
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getSkipLibrariesDiscovery();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
28,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1016,6 +1028,24 @@ proto.cc.arduino.cli.commands.v1.CompileRequest.prototype.setEncryptKey = functi
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool skip_libraries_discovery = 28;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.CompileRequest.prototype.getSkipLibrariesDiscovery = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 28, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.CompileRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.CompileRequest.prototype.setSkipLibrariesDiscovery = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 28, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
|
||||
@@ -26,6 +26,9 @@ export class PlatformInstallRequest extends jspb.Message {
|
||||
getSkipPostInstall(): boolean;
|
||||
setSkipPostInstall(value: boolean): PlatformInstallRequest;
|
||||
|
||||
getNoOverwrite(): boolean;
|
||||
setNoOverwrite(value: boolean): PlatformInstallRequest;
|
||||
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformInstallRequest.AsObject;
|
||||
@@ -44,6 +47,7 @@ export namespace PlatformInstallRequest {
|
||||
architecture: string,
|
||||
version: string,
|
||||
skipPostInstall: boolean,
|
||||
noOverwrite: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -339,7 +339,8 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.toObject = function(incl
|
||||
platformPackage: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
architecture: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
version: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
||||
skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
|
||||
skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
|
||||
noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 6, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -397,6 +398,10 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.deserializeBinaryFromRea
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setSkipPostInstall(value);
|
||||
break;
|
||||
case 6:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setNoOverwrite(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -462,6 +467,13 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.serializeBinaryToWriter
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getNoOverwrite();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
6,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -574,6 +586,24 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setSkipPostIns
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool no_overwrite = 6;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.getNoOverwrite = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformInstallRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setNoOverwrite = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 6, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -79,6 +79,9 @@ export class LibraryInstallRequest extends jspb.Message {
|
||||
getNoDeps(): boolean;
|
||||
setNoDeps(value: boolean): LibraryInstallRequest;
|
||||
|
||||
getNoOverwrite(): boolean;
|
||||
setNoOverwrite(value: boolean): LibraryInstallRequest;
|
||||
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): LibraryInstallRequest.AsObject;
|
||||
@@ -96,6 +99,7 @@ export namespace LibraryInstallRequest {
|
||||
name: string,
|
||||
version: string,
|
||||
noDeps: boolean,
|
||||
noOverwrite: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -967,7 +967,8 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.toObject = function(inclu
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
version: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
noDeps: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
|
||||
noDeps: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
||||
noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -1021,6 +1022,10 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.deserializeBinaryFromRead
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setNoDeps(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setNoOverwrite(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -1079,6 +1084,13 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.serializeBinaryToWriter =
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getNoOverwrite();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
5,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1173,6 +1185,24 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.setNoDeps = fun
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool no_overwrite = 5;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.getNoOverwrite = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LibraryInstallRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.setNoOverwrite = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 5, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user