Skip to content

Problems with files generated by grunt-contrib-less on Windows #2

@celsomiranda

Description

@celsomiranda

I get this error using Grunt-Github-Pages on Windows:

Warning: Command failed: warning: LF will be replaced by CRLF in assets/css/screen.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
Use --force to continue.

The file in question is generated using grunt-contrib-less using this Grunt file:

module.exports = function(grunt) {

  // load all grunt tasks
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-open');
  grunt.loadNpmTasks('grunt-github-pages');

  // Project configuration.
  grunt.initConfig({

    copy: {
      dist: {
        files: {
          '_site_git/' : '_site/**'
        }
      },
      css : {
        files: {
          '_site/assets/css/screen.css': 'assets/css/screen.css'
        }
      }
    },
    shell: {
      jekyll: {
        command: [
            'jekyll build'
        ].join('&&'),
        options: {
          stdout: true          
        }
      }
    },
    less: {
      development: {
        options: {
          paths: ['assets/less/']
        },
        files: {
          'assets/css/screen.css': 'assets/less/main.less'
        }
      }
    },

    watch: {
      options: {
        livereload: true
      },
      less: {
        files: ['assets/less/**/*.less'],
        tasks: ['lessCopy']
      },
      jekyllSources: {
        files: [
          // capture all except css  
          '**/*.html',
          '**/*.md',
          '*.yml',
          'assets/js/**.js',
          'atom.xml'
        ],
        tasks: ['shell:jekyll']
      }
    },

    connect: {
      server: {
        options: {
          base: '_site/',
          port: 80
        }
      }
    },
    open: {
      server: {
        path: 'http://celsomiranda.net.local/'
      }
    },

    githubPages: {
      target: {
        options: {
          // The default commit message for the gh-pages branch
          commitMessage: 'push',
          pushBranch: 'master'
        },
        // The folder where your gh-pages repo is
        src: '_site',
        // The second ignored directory with the .git folder
        dest: '_site_git'
      }
    }

  });

  // create an alias for the less watch tasks
  grunt.registerTask('lessCopy', ['less:development', 'copy:css']);

  // create an alias for the connect and watch tasks
  grunt.registerTask('server', ['connect:server', 'open:server', 'watch']);

  // create an alias for the githubPages task
  grunt.registerTask('deploy', ['githubPages:target']);

  // Default task.
  grunt.registerTask('default', 'server');
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions