Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/snowdog/frontools/task/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/snowdog/frontools/task/setup.js
'use strict';
module.exports = function() { // eslint-disable-line func-names
  // Global variables
  const plugins              = this.opts.plugins,
        config               = this.opts.configs,
        path                 = require('path'),

        // Create a relative symlink in project root to /vendor/snowdog/frontools
        relativeDirectory    = path.relative(config.projectPath, plugins.fs.realpathSync('./')),
        symlinkDirectoryName = plugins.util.env.symlink || 'tools',

        // Set config files paths
        configSamplesPath    = './config/',
        configPath           = config.projectPath + 'dev/tools/frontools/config/';

  try {
    plugins.fs.symlinkSync(relativeDirectory, config.projectPath + '/' + symlinkDirectoryName, 'dir');

    plugins.util.log(
      plugins.util.colors.green('Symlink created. You can now use Frontools from the "' + symlinkDirectoryName + '" directory.')
    );
  }
  catch (error) {
    plugins.util.log(
      plugins.util.colors.yellow(symlinkDirectoryName + ' already exists. Skipped it.')
    );
  }

  // Copy all all non existent config files to /dev/tools/frontools/config/
  plugins.fs.readdirSync(configSamplesPath).forEach((fileName) => {
    const newFileName = fileName.replace('.sample', '');

    try {
      plugins.fs.copySync(configSamplesPath + fileName, configPath + newFileName, {
        overwrite: false,
        errorOnExist: true
      });

      plugins.util.log('File ' + fileName + ' copied to /dev/tools/frontools/config/' + newFileName);
    }
    catch (error) {
      plugins.util.log(
        plugins.util.colors.yellow('File ' + newFileName + ' already exists. Skipped it.')
      );
    }
  });

  plugins.util.log(
    plugins.util.colors.green('Setup complete! Go to "/dev/tools/frontools/config/" directory and edit the configuration there.')
  );
};

Spamworldpro Mini