mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Don't rewrite settings if just moving the key
This commit is contained in:
@@ -96,6 +96,13 @@ function readSecretState() {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function migrateSecrets(settingsFile) {
|
function migrateSecrets(settingsFile) {
|
||||||
|
const palmKey = readSecret('api_key_palm');
|
||||||
|
if (palmKey) {
|
||||||
|
console.log('Migrating Palm key...');
|
||||||
|
writeSecret(SECRET_KEYS.MAKERSUITE, palmKey);
|
||||||
|
deleteSecret('api_key_palm');
|
||||||
|
}
|
||||||
|
|
||||||
if (!fs.existsSync(settingsFile)) {
|
if (!fs.existsSync(settingsFile)) {
|
||||||
console.log('Settings file does not exist');
|
console.log('Settings file does not exist');
|
||||||
return;
|
return;
|
||||||
@@ -130,14 +137,6 @@ function migrateSecrets(settingsFile) {
|
|||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const palmKey = readSecret('api_key_palm');
|
|
||||||
if (palmKey) {
|
|
||||||
console.log('Migrating Palm key...');
|
|
||||||
writeSecret(SECRET_KEYS.MAKERSUITE, palmKey);
|
|
||||||
deleteSecret('api_key_palm');
|
|
||||||
modified = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modified) {
|
if (modified) {
|
||||||
console.log('Writing updated settings.json...');
|
console.log('Writing updated settings.json...');
|
||||||
const settingsContent = JSON.stringify(settings, null, 4);
|
const settingsContent = JSON.stringify(settings, null, 4);
|
||||||
|
Reference in New Issue
Block a user