byteface / sharpshooter

A shorthand for creating files and folders. (A parser could be written in any language)
MIT License
11 stars 1 forks source link

- doesn't windows have backslash? test on my other machine later #6

Closed github-actions[bot] closed 3 years ago

github-actions[bot] commented 3 years ago

This issue was automatically created by a github action that converts project Todos to issues.

https://github.com/byteface/sharpshooter/blob/0f6c3e759e2612b51b0fdba8655f58894cd425ee/sharpshooter/__init__.py#L504


            else:
                if not self.delete:

                    if tree.TEST_MODE:
                        # TODO - doesn't windows have backslash? test on my other machine later
                        sslog(f"TEST_MODE: create file: {self.cwd}/{file_name}")
                    else:
                        if not os.path.exists(os.path.join(self.cwd, file_name)):
                            with open(os.path.join(self.cwd, file_name), "w") as f:
                                f.write(t.value)
                        else:
                            sslog("file already exists")

                else:
                    try:
                        # os.remove(os.path.join(self.cwd, file_name))
byteface commented 3 years ago

note to self...

import os
print(os.sep)