深度文管 - Git打包扩展
Tofloor
poster avatar
海天鹰
deepin
2020-03-14 21:14
Author
本帖最后由 sonichy 于 2020-3-15 10:18 编辑

作为一个经常使用Git的开发者,以前都是当前目录全选打包备份,都是对于Android那种多层目录结构包就太大了,变通为 git push 后到网站下载zip包,很痛苦。
后来知道了 git ls-files 可以列出git文件列表,能不能送给打包软件呢?
首先在终端实现了,昨天又在海天鹰文管实现了,今天在深度文管实现了。
编辑 ~/.config/deepin/dde-file-manager/menuextensions 文件,文件不存在就新建:
  1. [
  2.     {
  3.         "MenuType": "EmptyArea",
  4.         "NotShowIn": ["Desktop"],
  5.         "Icon": "application-gzip",
  6.         "Text[zh_CN]": "Git打包tar.gz",
  7.         "Exec": "/xxx/xxx/xxx/xxx/xxx/GitTarGz.sh"
  8.     }
  9. ]
Copy the Code
GitTarGz.sh
  1. #!/bin/bash
  2. path=`pwd`
  3. filename=${path##*/}
  4. echo $filename
  5. git ls-files | xargs tar -czvf $filename.tar.gz
Copy the Code

这样,就可以打包 tar.gz 了。

我更喜欢打包 zip:
  1. #!/bin/bash
  2. list=`git ls-files`
  3. path=`pwd`
  4. filename=${path##*/}
  5. echo $filename
  6. zip $filename -xi $list
Copy the Code


Reply Favorite View the author
All Replies
avatar
蒙笛
deepin
2020-03-22 23:56
#1
本帖最后由 yuzh496 于 2020-3-22 16:07 编辑

哇,大佬的帖子竟然没人回复,虽然看不懂,但还是帮顶一下。

@sonichy   你的酷狗客户端还在维护吗?
Reply View the author
avatar
海天鹰
deepin
2020-04-04 20:06
#2
https://bbs.deepin.org/post/189715
哇,大佬的帖子竟然没人回复,虽然看不懂,但还是帮顶一下。

@sonichy   你的酷狗客户端还在维护吗?

酷狗运转正常,只是没有新功能。
Reply View the author
avatar
archlte
deepin
2020-04-04 20:21
#3
支持一下
Reply View the author
avatar
观摩
deepin
2020-04-04 21:12
#4
我参考这个试着给文管加一个菜单,UOS下好像不生效
Reply View the author