GithubHelp home page GithubHelp logo

Cleaning a directory about copycat-action HOT 5 CLOSED

andstor avatar andstor commented on August 14, 2024
Cleaning a directory

from copycat-action.

Comments (5)

andstor avatar andstor commented on August 14, 2024 1

Yes, you have specified the destination path to resolve to the root of the yceballost.github.io. When using clean, this will clean the destination path. If this is a directory the directory will be deleted. If it is a file, the file will be deleted. Since your dst_path resolves to the root directory, the entire repo is deleted.

Ok, so lets see if I correctly understand what you want.

You want to copy a folder named icn_export to the root of yceballost.github.io.
If the icn_export folder already exists in the yceballost.github.io repo, then you want to delete it first. Correct?

If that's the case, change the src_path to /icn_export/.. Then set the dst_path to /icn_export/.. When clean is set to true, if a icn_export folder exists in yceballost.github.io, it will be emptied (effectively deleted). Then the action will copy over the new icn_export folder from the source repo.

from copycat-action.

andstor avatar andstor commented on August 14, 2024 1

Great ! Happy to help πŸ˜„

If you by "fullstop" is referring to the dot ., it technically has no meaning πŸ˜†. The dotslash /. is similar to a "no-op", and refers to the immediately preceding directory. So you could also just ended with a slash "/". However, I do often find it useful to include. I tend to think of it as "the contents of this folder".

However, note that it is NOT the same if you end with just text, for example /icn_export. This means the actual file or folder. Adding a slash to the end like /icn_export/ makes the expression handle the path as a directory.

from copycat-action.

andstor avatar andstor commented on August 14, 2024 1

Actually, I did some testing and I discovered that this is actually not the case with Copycat 😱. The UNIX file system should behave as described above. However, it seems that Copycat treats a trailing slash /and a trailing dotslash /.differently 😨 Specifically, it is the ending with / that is faulty.

I need to investigate this further. However, just use a trailing slashdot /. if you want to refer to the contents of a folder. That works as expected and will not break with a potential fix πŸ˜…. If you actually want to refer to the folder (or file) don't add anything to the end (just text).

from copycat-action.

yceballost avatar yceballost commented on August 14, 2024

Works perfect! Thanks mate!

What is the meaning of this last fullstop? /icn_export/.

from copycat-action.

andstor avatar andstor commented on August 14, 2024

I think I got a bit carried away 😊 I forgot I am not following standard POSIX file system behavior. A lot of the standard cmd tools handles path resolving differently. Copycat heavily utilizes the unix cp command. This utility seems to be the source of the "problems". However, we should create clearer and more detailed documentation regarding how Copycat handles paths.

from copycat-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.