我有类似的字符串
A_B_C_D
A_B___C_D
Run Code Online (Sandbox Code Playgroud)
其中,___可在字符串中的任何地方.
将它们分成任何一个_但不是最简单的方法是什么___?
我想使用Grunt和rsync将一些代码从我的计算机(Windows)部署到服务器(Linux).
我的Gruntfile.js是
module.exports = function(grunt) {
grunt.initConfig({
rsync: {
options: {
args: ['--verbose', '--chmod=777'],
exclude: ['*.git', 'node_modules'],
recursive: true
},
production: {
options: {
src: './bitzl.com',
dest: '/home/marcus/bitzl.com',
host: 'marcus@bitzl.com',
syncDest: true
}
}
}
});
grunt.loadNpmTasks('grunt-rsync');
}
Run Code Online (Sandbox Code Playgroud)
请注意,我用的home目录marcus和chmod=777只是为了简化测试.
运行grunt rsync失败:
Running "rsync:production" (rsync) task
rsyncing ./example.com >>> /home/marcus/bitzl.com
Shell command was: rsync ./bitzl.com marcus@bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-exc
luded --exclude=*.git --exclude=node_modules --verbose --chmod=777
ERROR
Error: rsync exited with code 12 …Run Code Online (Sandbox Code Playgroud)