Skip to content

Commit

Permalink
fix(scripts): improve script
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 5, 2018
1 parent 3ba506c commit 2215c6a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .scripts/prepare.js
Expand Up @@ -111,7 +111,7 @@ async function preparePackages(packages, version) {
// generate changelog
generateChangeLog(tasks);

const listr = new Listr(tasks, { showSubtasks: false });
const listr = new Listr(tasks, { showSubtasks: true });
await listr.run();
}

Expand Down Expand Up @@ -154,7 +154,7 @@ function preparePackage(tasks, package, version) {
const projectRoot = common.projectPath(package);
const pkg = common.readPkg(package);

tasks.push(
const projectTasks = [
{
title: `${pkg.name}: validate new version`,
task: () => {
Expand All @@ -170,10 +170,10 @@ function preparePackage(tasks, package, version) {
await execa('npm', ['install'], { cwd: projectRoot });
}
}
);
];

if (package !== 'core') {
tasks.push(
projectTasks.push(
{
title: `${pkg.name}: npm link @ionic/core`,
task: () => execa('npm', ['link', '@ionic/core'], { cwd: projectRoot })
Expand All @@ -188,7 +188,7 @@ function preparePackage(tasks, package, version) {
);
}

tasks.push(
projectTasks.push(
{
title: `${pkg.name}: lint`,
task: () => execa('npm', ['run', 'lint'], { cwd: projectRoot })
Expand All @@ -204,13 +204,19 @@ function preparePackage(tasks, package, version) {
);

if (package === 'core') {
tasks.push(
projectTasks.push(
{
title: `${pkg.name}: npm link`,
task: () => execa('npm', ['link'], { cwd: projectRoot })
}
);
}

// Add project tasks
tasks.push({
title: `Prepare ${chalk.bold(pkg.name)}`,
task: () => new Listr(projectTasks)
});
}

function updateDependency(pkg, dependency, version) {
Expand Down

0 comments on commit 2215c6a

Please sign in to comment.