Skip to content

Commit

Permalink
fix(demo) update publish script to change the baseUrl of the previous…
Browse files Browse the repository at this point in the history
… version (#71)

* update publish script to change the baseUrl of the previous version

* fix(demo):fix path in publish-demo.js
  • Loading branch information
oussamahamdaoui authored and guillaumechervetaxa committed Feb 13, 2019
1 parent 452f21a commit fb6250f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/publish-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ try {
console.log('stdout ', child.stdout);
console.log('stderr ', child.stderr);

const PREVIOUS_VERSION = require('../tmp/AxaGuilDEv.github.io/react-toolkit/latest/version.json').version;
const PREVIOUS_VERSION = require('./tmp/AxaGuilDEv.github.io/react-toolkit/latest/version.json').version;

fs.moveSync('./tmp/AxaGuilDEv.github.io/react-toolkit/latest', `./tmp/AxaGuilDEv.github.io/react-toolkit/v${PREVIOUS_VERSION}`);

const environment = require(`./tmp/AxaGuilDEv.github.io/react-toolkit/v${PREVIOUS_VERSION}/demo/environment.json`);
environment.baseUrl = `/react-toolkit/v${PREVIOUS_VERSION}/demo/`;

fs.writeFileSync(`./tmp/AxaGuilDEv.github.io/react-toolkit/v${PREVIOUS_VERSION}/demo/environment.json`, JSON.stringify(environment), 'utf8');

fs.copySync(`./storybook/styles/distDemo`, `./tmp/AxaGuilDEv.github.io/react-toolkit/latest/design`);
fs.copySync(`./storybook/storybook/storybook-static`, `./tmp/AxaGuilDEv.github.io/react-toolkit/latest/storybook`);
fs.copySync(`./examples/demo/build`, `./tmp/AxaGuilDEv.github.io/react-toolkit/latest/demo`);
Expand Down

0 comments on commit fb6250f

Please sign in to comment.