2017-03-14 12:25:39 +01:00
|
|
|
const shell = require('shelljs');
|
|
|
|
|
2017-08-09 22:21:08 +02:00
|
|
|
// Store installation start date.
|
|
|
|
const installationStartDate = new Date();
|
|
|
|
|
2017-03-14 12:25:39 +01:00
|
|
|
// Remove existing binary.
|
|
|
|
shell.rm('-f', '/usr/local/bin/strapi.js');
|
|
|
|
|
|
|
|
shell.echo('Linking Strapi CLI...');
|
2017-08-09 22:09:41 +02:00
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('packages/strapi-utils');
|
2017-07-19 17:03:03 +02:00
|
|
|
shell.exec('npm link');
|
2017-08-09 22:09:41 +02:00
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi-generate');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-utils');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi-admin');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-utils');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi-generate-admin');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-admin');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi-generate-new');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-utils');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi-mongoose');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-utils');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
2017-07-17 16:48:09 +02:00
|
|
|
shell.cd('../strapi');
|
2017-08-09 22:09:41 +02:00
|
|
|
shell.exec('npm install ../strapi-generate ../strapi-generate-admin ../strapi-generate-api ../strapi-generate-new ../strapi-generate-policy ../strapi-generate-service ../strapi-mongoose ../strapi-utils');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
|
|
|
shell.cd('../strapi-helper-plugin');
|
2017-08-23 17:14:44 +02:00
|
|
|
shell.exec('npm link');
|
2017-08-09 22:09:41 +02:00
|
|
|
|
|
|
|
shell.cd('../strapi-plugin-content-manager');
|
|
|
|
shell.exec('npm install ../strapi-helper-plugin');
|
|
|
|
shell.rm('-f', 'package-lock.json');
|
|
|
|
shell.exec('npm link');
|
|
|
|
|
|
|
|
shell.cd('../strapi-plugin-settings-manager');
|
|
|
|
shell.exec('npm install ../strapi-helper-plugin');
|
|
|
|
shell.rm('-f', 'package-lock.json');
|
|
|
|
shell.exec('npm link');
|
2017-08-09 22:21:08 +02:00
|
|
|
|
|
|
|
// Log installation duration.
|
|
|
|
const installationEndDate = new Date();
|
|
|
|
const duration = (installationEndDate.getTime() - installationStartDate.getTime()) / 1000;
|
|
|
|
shell.echo('Strapi has been succesfully installed.');
|
|
|
|
shell.echo(`Installation took ${Math.floor(duration / 60) > 0 ? `${Math.floor(duration / 60)} minutes and ` : ''}${duration % 60} seconds.`);
|