简体   繁体   English

mv:无法统计“./temp”:github 操作上没有此类文件或目录

[英]mv: cannot stat './temp': No such file or directory on github actions

I made a github workflow that takes a folder's contents and stores it temporarily in another directory, it being this:我制作了一个 github 工作流程,它获取文件夹的内容并将其临时存储在另一个目录中,它是这样的:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: Create temp folder
        run: |
         cd ..
         cp ./FlexLauncher ./temp -r
         cd ./temp
         ls
         cd ..
      - name: Move temp to main folder
        run: |
         mv ./temp ./FlexLauncher
         ls

The results of the first ls show that the folder exists, as I can cd into it and ls the contents.第一个 ls 的结果显示该文件夹存在,因为我可以 cd 进入它并 ls 内容。


Run cd ..
  cd ..
  cp ./FlexLauncher ./temp -r
  cd ./temp
  ls
  cd ..
  shell: /usr/bin/bash -e {0}
README.md
main.js
main.py
package-lock.json
package.json
web

I get the error in the second step:我在第二步中得到错误:

Run mv ./temp ./FlexLauncher
  mv ./temp ./FlexLauncher
  ls
  shell: /usr/bin/bash -e {0}
mv: cannot stat './temp': No such file or directory
Error: Process completed with exit code 1.

Take a look at the documentation for GitHub actions:查看 GitHub 操作的文档

Each run keyword represents a new process and shell in the runner environment.每个run关键字代表 runner 环境中的一个新进程和 shell。 When you provide multi-line commands, each line runs in the same shell.当您提供多行命令时,每行都运行在同一个 shell 中。

You can use the "working-directory" attribute to specify the folder where the script should be executed:您可以使用“working-directory”属性来指定应该执行脚本的文件夹:

      - name: Create temp folder
        working-directory: /your/path
        run: |
         cp ./FlexLauncher ./temp -r
         cd ./temp
         ls
      - name: Move temp to main folder
        working-directory: /your/path
        run: |
         mv ./temp ./FlexLauncher
         ls

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法统计“b2”:没有这样的文件或目录 - Cannot stat 'b2': No such file or directory 安装 Podman DNSname - install: cannot stat 'bin/dnsname': No such file or directory - Installing Podman DNSname - install: cannot stat 'bin/dnsname': No such file or directory 为安全虚拟专用网络启动Monitor Daemon:cp:无法统计`/ etc / inittab':没有这样的文件或目录 - Starting Monitor Daemon for Secure Virtual Private Network: cp: cannot stat `/etc/inittab': No such file or directory Ubuntu-MV:移动目录 - Ubuntu - mv: moving a directory Qt Creator中的OpenCV:无法连接创建者comm套接字/tmp/qt_temp.T32147/stub-socket:无此类文件或目录 - OpenCV in Qt Creator : Cannot connect creator comm socket /tmp/qt_temp.T32147/stub-socket: No such file or directory 错误:ENOENT:没有这样的文件或目录,stat '/home/arpit/.steampath' - Error: ENOENT: no such file or directory, stat '/home/arpit/.steampath' 失败:mongorestore 目标“转储”无效:统计转储:没有这样的文件或目录 - Failed: mongorestore target 'dump' invalid: stat dump: no such file or directory Ubuntu的MV文件消失了 - ubuntu mv file disappeared Github 动作无法运行 ubuntu 中的 config.sh 文件 20.04 - Github actions can not run the config.sh file in the ubuntu 20.04 无法为此处文档创建临时文件:设备上没有剩余空间 - cannot create temp file for here-document: No space left on device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM