From 44e510f68b8d4fce1de80acc270ad8ee9f57f80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Georget?= Date: Mon, 16 Nov 2015 15:43:52 +0100 Subject: [PATCH] Delete previous application --- bin/strapi-link.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/strapi-link.js b/bin/strapi-link.js index b8d4793a5d..8e469dffb8 100644 --- a/bin/strapi-link.js +++ b/bin/strapi-link.js @@ -35,7 +35,9 @@ const logger = new (winston.Logger)({ module.exports = function () { const HOME = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME']; const pathToPackageJSON = path.resolve(process.cwd(), 'package.json'); + const pathToStudioJSON = path.resolve(process.cwd(), 'config', 'studio.json'); const appPkg = JSON.parse(fs.readFileSync(pathToPackageJSON)); + const studioConfig = JSON.parse(fs.readFileSync(pathToStudioJSON)); let invalidPackageJSON; // First, check if we are in a Strapi project. @@ -86,7 +88,8 @@ module.exports = function () { uri: 'http://studio.strapi.io/app', body: { name: appPkg.name, - token: config.token + token: config.token, + appToDelete: studioConfig.studio.appId } },