text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const del = require("del");
  const vinylPaths = require("vinyl-paths");
  const path = require("path");
  const fs = require("fs-extra");
  function replaceFileIfExists(sourcePath, targetPath) {
      if (!fs.existsSync(sourcePath)) {
          return;
      }
      const copyOptions = {
          clobber: true,
      };
      fs.copySync(sourcePath, targetPath, copyOptions);
  }
  function backupFile(filePath) {
      const folderPath = path.dirname(filePath);
      const originalFileExtension = path.extname(filePath);
      const originalFileName = path.basename(filePath, originalFileExtension);
      const backupFileName = `${originalFileName}_BACKUP${originalFileExtension}`;
      const backupFilePath = path.resolve(folderPath, backupFileName);
      replaceFileIfExists(filePath, backupFilePath);
  }
  function generate(gulp, config, gulptraum) {
      const pathsToCopy = [
          '../setup/sass-lint.yml',
      ];
      const setupOutputFolderPath = path.resolve(config.paths.root, config.paths.setup);
      gulptraum.task('setup-dev-sass-clean', {
          help: 'Cleans all code style files generated by the SASS plugin'
      }, () => {
          const cleanPaths = pathsToCopy.map((pathToCopy) => {
              return path.resolve(setupOutputFolderPath, pathToCopy);
          });
          return gulp.src(cleanPaths)
              .pipe(vinylPaths(del));
      });
      gulptraum.task('setup-dev-sass-build', {
          help: 'Copies sass-lint.yml to your project folder'
      }, () => {
          pathsToCopy.forEach((pathToCopy) => {
              const originalFileExtension = path.extname(pathToCopy);
              const originalFileName = path.basename(pathToCopy, originalFileExtension);
              const targetFileName = `${originalFileName}${originalFileExtension}`;
              const sourcePath = path.resolve(__dirname, pathToCopy);
              const targetPath = path.resolve(setupOutputFolderPath, targetFileName);
              if (config.backupSetupFiles) {
                  backupFile(targetPath);
              }
              replaceFileIfExists(sourcePath, targetPath);
          });
      });
      gulptraum.task('setup-dev-sass', {
          help: 'Copies SASS code styles files to your project folder'
      }, (callback) => {
          const tasksToRun = [];
          if (!config.backupSetupFiles) {
              tasksToRun.push('setup-dev-sass-clean');
          }
          tasksToRun.push('setup-dev-sass-build');
          return gulptraum.gulpAdapter.runTasksSequential(tasksToRun, callback);
      });
  }
  exports.generate = generate;
  module.exports.generate = generate;
  
  //# sourceMappingURL=setup_dev.js.map
  