0.2.3 • Published 7 years ago
grunt-get-git v0.2.3
grunt-get-git
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