How do I extend a regular expression to exclude all files in a folder?

前端 未结 3 1399
天命终不由人
天命终不由人 2021-02-07 20:37

In the app.yaml file of my Google App Engine project there is a skip_files section used to exclude files of given types from being uploaded. How do I extend this regular express

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 21:38

    With a new app (as of this writing) you can simply put the directory name with a trailing slash (as indicated by the app.yaml docs)

    So your app.yaml might look like: skip_files: - node_modules/ - ^(.*/)?app\.yaml - ^(.*/)?app\.yml - ^(.*/)?index\.yaml - ^(.*/)?index\.yml ...

    However, when trying to ignore a huge directory like node_modules, you will find the following easier to deal with: (- ^node_modules/*.*). This solution will print a single, nice message like INFO: Ignoring directory [node_modules]: Directory matches ignore regex. when deploying with gcloud app deploy.

    Unfortunately gcloud app deploy will still locally copy all files in the deploy directory to /var/folders/... even though you have ignored certain directories/files. Those files won't be uploaded to google though.

提交回复
热议问题