MAC Shell Notes

Source: Internet
Author: User

Used to automate some of the front-end publishing operations.

Script:

# Webreleasepath is used to publish the directory, Webrevisionpath is the development of the directory Webreleasepath='/users/lufeng/documents/project/pc-link/web-release'Webrevisionpath='/users/lufeng/documents/project/pc-link/web-revision/project'# Build Vue ProjectEcho '1. Compile Vue project ...'CD $webRevisionPathnpm Run build# empty the release directory except. GitEcho '2. Clear the Release directory'CD $webReleasePathfiles=`ls-A ' forFileNameinch$files;  Do            if[[$fileName = ='. Git']]; Then            Echo '......'          Else            RM-RF $fileNamefi        Done# Copy published content pastEcho '3. Publish to the release directory'CD $webRevisionPath'/dist'Files=`ls-A ' forFileNameinch$files;  Do            CP-R $fileName $webReleasePath DoneEcho '4. Commit git'CD $webReleasePathgit Add-Agit Commit-M'Robot Submission'git push Origin head:developEcho 'done! '

Attention:

1. After saving the file, add execute (x) permission to the script, chmod +x youname.sh

MAC Shell Notes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.