downgoon / cpmd Goto Github PK
View Code? Open in Web Editor NEWcopy or move markdown files (supporting wildcard characters) to the destination directory **with their attached images** usually located on sub dir named 'assets' or 'images'.
copy or move markdown files (supporting wildcard characters) to the destination directory **with their attached images** usually located on sub dir named 'assets' or 'images'.
$ cpmd -s 前缀1-abc.md -d 前缀专题/
cp images/20181112094421371.png to /Users/downgoon/Documents/markdown/前缀专题/
cp images/20181112095727825.png to /Users/downgoon/Documents/markdown/前缀专题/
cp images/20181112100214339.png to /Users/downgoon/Documents/markdown/前缀专题/
cp images/orders-er.jpg to /Users/downgoon/Documents/markdown/前缀专题/
cp 前缀1-abc.md to /Users/downgoon/Documents/markdown/前缀专题/
$ cpmd -s 前缀2-def.md -d 前缀专题/
cp assets/image-20181121154140531-2786100.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121154224083-2786144.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121181058827-2795058.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121181214371-2795134.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121175308375-2793988.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121152713374-2785233.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121150555166-2783955.png to /Users/downgoon/Documents/markdown/前缀专题/
cp assets/image-20181121151311048-2784391.png to /Users/downgoon/Documents/markdown/前缀专题/
cp 前缀2-def.md to /Users/downgoon/Documents/markdown/前缀专题/
➜ markdown git:(master) which pngmin
pngmin: aliased to source ~/myconf/markdown/pngmin.sh
➜ markdown git:(master) cat ~/myconf/markdown/pngmin.sh
#!/bin/bash
echo "scan large png (1M+) ..."
find $1 -name "*.png" -size +1M
echo "---"
echo "compress ..."
find $1 -name "*.png" -size +1M -exec pngquant -f --ext .png {} \;
echo "---"
echo "after compressed: "
find $1 -name "*.png" -mmin -3
➜ markdown git:(master)
sometimes a markdown file contains lots of images stored at cloud storages such as amazon S3. how to download them and put them in local dir ?
$ tree .
├── README.md
├── assets
│ ├── image-20190708204512742.png
$ cpmd -s README.md -d hexo-blog/source/_post/ --hexo
$ tree hexo-blog/source/_post/
├── README
│ └── image-20190708204512742.png
├── README.md
NOTE: The contents of copied file
README.md
are changed at images referencing.
➜ cpmd git:(master) git status
位于分支 master
您的分支与上游分支 'origin/master' 一致。
尚未暂存以备提交的变更:
(使用 "git add <文件>..." 更新要提交的内容)
(使用 "git checkout -- <文件>..." 丢弃工作区的改动)
修改: README.md
修改尚未加入提交(使用 "git add" 和/或 "git commit -a")
➜ cpmd git:(master) ✗ git add .
➜ cpmd git:(master) ✗ git commit -m 'Branch protection rule | Include administrators'
[master 6d9b494] Branch protection rule | Include administrators
1 file changed, 1 deletion(-)
➜ cpmd git:(master)
➜ cpmd git:(master)
➜ cpmd git:(master) git push origin master
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: At least 1 approving review is required by reviewers with write access.
To github.com:downgoon/cpmd.git
! [remote rejected] master -> master (protected branch hook declined)
error: 推送一些引用到 '[email protected]:downgoon/cpmd.git' 失败
➜ cpmd git:(master)
remote: error: At least 1 approving review is required by reviewers with write access.
$ cpmd README.md subdir/
/usr/local/lib/node_modules/cpmd/node_modules/command-line-args/dist/index.js:1345
throw err
^
UNKNOWN_VALUE: Unknown value: README.md
at commandLineArgs (/usr/local/lib/node_modules/cpmd/node_modules/command-line-args/dist/index.js:1342:21)
at Object.<anonymous> (/usr/local/lib/node_modules/cpmd/cpmd.js:16:17)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)
at internal/main/run_main_module.js:17:11 {
name: 'UNKNOWN_VALUE',
value: 'README.md'
}
$ cpmd -s README.md -d subdir/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.