Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bat upload jdf u -list #19

Merged
merged 1 commit into from
Nov 28, 2015
Merged

bat upload jdf u -list #19

merged 1 commit into from
Nov 28, 2015

Conversation

beanlee
Copy link
Contributor

@beanlee beanlee commented Nov 25, 2015

可在 config.json
配置中增加uploadList节点,value可以为一个或多个文件,达到多文件批量上传效果,可将短期内需要反复上传的文件配置在其中,如
"uploadList":"css/i/selected-icon.png,js/" 批量上传无需反复输入多个文件名
_112515_014510_pm
_112515_014858_pm
_112515_020422_pm

可在 config.json
配置中增加uploadList对应value,可以为一个或多个文件,达到多文件批量上传效果,可将短期内需要反复上传的文件配置在其中,如
"uploadList":"css/i/selected-icon.png,js/" 批量上传无需反复敲文件名
@beanlee
Copy link
Contributor Author

beanlee commented Nov 26, 2015

PS. 该方式可能存在一个问题
config.json 文件属于项目文件,误提交以免影响其他人批量 upload 文件,建议用户使用时个人分支.gitignore配置排除掉此项

@keelii
Copy link
Contributor

keelii commented Nov 26, 2015

改配置文件成本太高了,还不如直接设计成这样:

jdf u path/to/file1,/path/to/file2

@beanlee
Copy link
Contributor Author

beanlee commented Nov 26, 2015

你这样还是没有解决,反复输入文件名的问题,我们组遇到的问题是多人同时开发一个项目,代码多分支,当其中某一人需要频繁上传一些文件时有这样的需求

@putaoshu
Copy link
Owner

@keelii 说的有道理呢,把这段代码

jdf u path/to/file1,/path/to/file2

写入一个xx.bat或者xx.sh,并且此文件不入版本库,是不是也能满足你的需求呢?

@keelii
Copy link
Contributor

keelii commented Nov 26, 2015

@beanlee
多人同时开发一个项目要看是不是同一个需求(feature branch)分支

如果是同一个需求分支那肯定是没办法解决的,最好是在本地测试好了再传测试环境

如果是同一项目不同的需求的话我们的解决方案是加不同的版本号(需要后端支持):

projectPatch: 'item/1.0.0'

这个版本号1.0.0会通过后端接收 url 参数动态渲染到页面引用的css,js文件版本:

http://item.jd.com/version=1.0.0
<link href="path/to/stylesheet/item/1.0.0/??a,css,b.css" />
<script>
seajs.config({
  path: 'path/to/1.0.0/directory'
});
</script>

@beanlee
Copy link
Contributor Author

beanlee commented Nov 26, 2015

嗯,我们组同学遇到的这个问题时候,我最开始想也是使用bat或者sh来执行jdf命令就可以解决,比如单独一个文本用来存储需要批量上传的不同目录的多个文件,做的过程中看了一下jdf关于upload的方法,发现第三个参数是可以根据配置传递的,于是就有了这pull request :)
不知道path的方式能否解决,同时上传多个不同目录的文件呢?

putaoshu pushed a commit that referenced this pull request Nov 28, 2015
batch upload files use "jdf u -list"
@putaoshu putaoshu merged commit dffe7ba into putaoshu:master Nov 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants