grunt-get-git

0.2.3 • Public • Published

grunt-get-git Build Status

Get the path of a local git repository

Locate a local git repository you want to deploy to and set a grunt.config variable with the path. You can use the path in any other grunt plugin during your building process.

Note: The getgit task needs to be run first in order to get the path for any consecutive tasks. See example for more info.

Install

$ npm install grunt-get-git --save-dev

Usage

getgit: {
    root: '/', // where to search, defaults to process.env.HOME
    repository: 'my-repo.git', // name of repository to search
    config: 'app.deployTo' // set the name of your config option
}

Example

getgit: {
    root: '/',
    repository: 'project-main-build.git',
    config: 'app.deployTo'
}

In any other task you can use

'<%= app.deployTo %>

For a copy task configuration like this

copy: {
    remote: {
        expand: true,
        dot: true,
        cwd: '<%= dist %>',
        dest: '<%= app.deployTo %>/static/',
        src: [
            'scripts/**/*',
            'styles/**/*'
        ]
    }
},

Your deploy process would look like this

grunt.registerTask('deploy', [
    'getgit',
    'copy:remote'
]);

Options

root

Type: String
Default: process.env.HOME

repository

Type: String
Default: null

config

Type: String
Default: depoloyPath

License

MIT

Package Sidebar

Install

npm i grunt-get-git

Weekly Downloads

1

Version

0.2.3

License

none

Last publish

Collaborators

  • svalchinov