'use strict';

const path = require('path');
const defaults = require('./defaults');
const chain = require('../../utils/chain');

const tasks = [
  'check-empty',
  'copy-files',
  'add-gitignore',
  'npm-init',
  'install-theme',
  'install-dependencies',
  'create-app'
];

function init(dir, options) {
  dir = dir || '.';
  dir = path.resolve(process.cwd(), dir);

  const settings = Object.assign({}, defaults, {
    dir,
    dirname: path.basename(dir),
    app: path.basename(dir)
  }, options);
  const root = path.resolve(__dirname, './tasks');
  return chain(tasks, root, settings)
    .then(() => {
      console.log('Done!');
      console.log('Run `npm start` or `docker-compose up` to start your hof service');
    });
}

module.exports = init;

'use strict';

const path = require('path');
const defaults = require('./defaults');
const chain = require('../../utils/chain');

const tasks = [
  'check-empty',
  'copy-files',
  'create-app',
  'add-gitignore',
  'npm-init',
  'install-theme',
  'install-dependencies'
];

function init(dir, options) {
  dir = dir || '.';
  dir = path.resolve(process.cwd(), dir);

  const settings = Object.assign({}, defaults, {
    dir,
    dirname: path.basename(dir),
    app: path.basename(dir)
  }, options);
  const root = path.resolve(__dirname, './tasks');
  return chain(tasks, root, settings)
    .then(() => {
      console.log('Done!');
      console.log('Run `npm start` or `docker-compose up` to start your hof service');
    });
}

module.exports = init;

Move app build to before install step
Move app build to before install step

The translations are compiled at `postinstall`, but they don't exist by then because the app is created later. Instead move the app creation phase to before "install" so all assets are correctly in place.
