mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-05 21:27:24 +02:00
23 lines
687 B
JavaScript
23 lines
687 B
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
const fs = require('fs-extra');
|
|
const chalk = require('chalk');
|
|
const path = require('path');
|
|
|
|
module.exports = async function eject(siteDir) {
|
|
const defaultTheme = path.resolve(__dirname, '..', 'theme');
|
|
const customTheme = path.resolve(siteDir, 'theme');
|
|
await fs.copy(defaultTheme, customTheme);
|
|
|
|
const relativeDir = path.relative(process.cwd(), customTheme);
|
|
console.log(
|
|
`\n${chalk.green('Success!')} Copied default theme files to ${chalk.cyan(
|
|
relativeDir,
|
|
)}.\n`,
|
|
);
|
|
};
|