使用最新值更新GIT文件夹

时间:2014-05-19 11:33:10

标签: javascript node.js gruntjs

    gitclone: {
      autojqm: {
        options: {
          repository: "https://github.com/imaginethepoet/autojqm"
          branch: "master"
          directory: "repo"
        }
      },
      otherrepo: {
        options: {
          repository: "https://example.com/anotherrepository"
          branch: "master"
          directory: "anotherfolder"
        }
      }
    }

grunt.loadNpmTasks('grunt-git');

    grunt.task.registerTask('gitclone', function() {
        if (this.name=="gitclone"){
            grunt.log.writeln("Hurray");
            gitmerge: {
                your_target: {
                    options: {
                        repository: "https://github.com/imaginethepoet/autojqm"
                        branch :"master"
                        directory:"anotherfolder"
                    }
                }
            }
        }
        else{
            grunt.log.writeln("OOps");
        }
    });


    grunt.registerTask('default', ['gitclone']);

我正在尝试访问已从GIT中提取的文件夹,而我只是尝试使用已添加的较新值覆盖该文件夹。 但我无法让我的文件夹保持最新状态。任何人都可以帮助我。

1 个答案:

答案 0 :(得分:1)

添加另一个目标。以下示例是普通的旧JavaScript,但我确定您可以将其更改为coffee:

gitclone: {
  autojqm: {
    options: {
      repository: "https://github.com/imaginethepoet/autojqm"
      branch: "master"
      directory: "repo"
    }
  },
  otherrepo: {
    options: {
      repository: "https://example.com/anotherrepository"
      branch: "master"
      directory: "anotherfolder"
    }
  }
}