Releases: downgoon/cpmd
Releases · downgoon/cpmd
hexo-style copy
hexo-style copy: in hexo, Asset folder will have the same name as the markdown file associated with the post. Place all assets related to your post into the associated folder, and you will be able to reference them using a relative path, making for an easier and more convenient workflow. For example:
- before coping, source layout of the markdown file and its attached images
$ tree .
├── README.md
├── assets
│ ├── image-20190708204512742.png
- after copying, destination layout
$ cpmd -s README.md -d hexo-blog/source/_post/ --hexo
$ tree hexo-blog/source/_post/
├── README
│ └── image-20190708204512742.png
├── README.md
multi copy or move
- Install: install command line tool 'cpmd' (copy markdown)
$ npm install cpmd -g
- Multi Copy/Move: copy two files named 'README.md' and 'REMORE.md'.
$ cpmd -s 'RE*.md' -d backup/
src file wildcard: RE*.md
src file list: README.md,REMORE.md
cp assets/image-20190625115442118.png to /Users/downgoon/Documents/backup/
cp README.md to /Users/downgoon/Documents/backup/
cp REMORE.md to /Users/downgoon/Documents/backup/
$ tree . # the two files' layout
.
├── README.md
├── REMORE.md
└── assets
└── image-20190625115442118.png
NOTE: wildcard src fie name like 'RE*.md' MUST be quoted by single quotation marks
'
.
- Single Copy: copy a single file named 'README.md' with its referenced image 'assets/image-20190625115442118.png' into the existed dir 'backup' in long term format.
$ cpmd --src README.md --dst backup/
src file wildcard: README.md
src file list: README.md
cp assets/image-20190625115442118.png to /Users/downgoon/Documents/backup
cp README.md to /Users/downgoon/Documents/backup
- Single Move: move a single file in short term format. the additional argument '-m' or
--move
indicates a moving operation rather than copying.
$ cpmd -s README.md -d backup/ -m
src file wildcard: README.md
src file list: README.md
mv assets/image-20190625115442118.png to /Users/downgoon/Documents/backup/
mv README.md to /Users/downgoon/Documents/backup/
copy markdown file with images
https://www.npmjs.com/package/cpmd
$ npm install -g cpmd
$ cpmd -s $src-file.md --dst backup/dir