Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Should not overwrite the existing files #1325

Closed
guneysus opened this issue Apr 28, 2016 · 2 comments
Closed

Should not overwrite the existing files #1325

guneysus opened this issue Apr 28, 2016 · 2 comments

Comments

@guneysus
Copy link

Description

While I am converting my projects to use brunch, with a folder structure app > assets > index.html

Running

brunch new -s es6

touches the app folder contents and overwrites existing files.

Expected behavior

Should not touch the files in the app/ folder.

Actual behavior

Tell us what actually happens.

If at all possible, please create a small demo app on GitHub that demonstrates the issue so it's easier for us to check and debug.

Environment

  1. Brunch: 2.6.6
  2. Node: v4.4.3
  3. NPM: 2.15.1
  4. Operating system: Windows 7 x64

package.json contents

{
  "name": "your-app",
  "description": "Description",
  "author": "Your Name",
  "version": "0.0.1",
  "repository": {
    "type": "git",
    "url": ""
  },
  "scripts": {
    "start": "brunch watch --server",
    "prod": "brunch build --production"
  },
  "dependencies": {  },
  "devDependencies": {
    "auto-reload-brunch": "^2.0.0",
    "babel-brunch": "~6.0.0",
    "babel-preset-es2015": "~6.3.13",
    "brunch": "^2.4.0",
    "clean-css-brunch": "^2.0.0",
    "css-brunch": "^2.0.0",
    "javascript-brunch": "^2.0.0",
    "uglify-js-brunch": "^2.0.0"
  }
}

brunch config contents

module.exports = {
  files: {
    javascripts: {
      joinTo: {
        'vendor.js': /^(?!app)/,
        'app.js': /^app/
      }
    },
    stylesheets: {joinTo: 'app.css'}
  },

  plugins: {
    babel: {presets: ['es2015']}
  }
};
@goshacmd
Copy link
Contributor

Skeletons are meant to quick-start new projects, and if you are transitioning to brunch, perhaps a better way would be to inspect the skeleton sources and try and adapt them to your app by hand.

That said, silently overwriting files does seem like an issue and should be addressed (and thanks for raising it!). I'm thinking either not overwriting at all and printing warnings, or prompting the user what to do are the ways to improve.

@goshacmd
Copy link
Contributor

goshacmd commented May 4, 2016

With the following PRs, the files should no longer be overwritten and the warnings will be printed whenever a file already exists

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants