Commit d63d9c77 authored by Adrian DC's avatar Adrian DC
Browse files

chore: prepare #185: use 'name' and 'folder' as Scripts properties

parent 123f9642
Loading
Loading
Loading
Loading
+3 −3
Changes for gitlabci_local/jobs/runner.py: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ class Jobs:
            scripts += entrypoint
        if not scripts:
            scripts = ['sh']
        scripts += ['"%s"' % script_file.name()]
        scripts += ['"%s"' % script_file.name]
        success = (system(' '.join(scripts)) == 0)

        # Result evaluation
@@ -418,8 +418,8 @@ class Jobs:
        script_file.write('exit "${result}"')

        # Prepare script execution
        script_stat = stat(script_file.name())
        chmod(script_file.name(), script_stat.st_mode | S_IXUSR | S_IXGRP
        script_stat = stat(script_file.name)
        chmod(script_file.name, script_stat.st_mode | S_IXUSR | S_IXGRP
              | S_IRGRP | S_IROTH | S_IXOTH)
        script_file.close()

+11 −0
Changes for gitlabci_local/jobs/scripts.py: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ class Scripts:

    # Members
    __file = None
    __folder = None
    __target = None

    # Constructor
@@ -26,6 +27,7 @@ class Scripts:

        # Prepare members
        self.__file = None
        self.__folder = None
        self.__target = None

        # Iterate through paths
@@ -34,6 +36,7 @@ class Scripts:
            # Prepare temporary script
            try:
                self.__file = Files.temp(path=path, prefix=prefix)
                self.__folder = path
                if isinstance(paths, dict) and paths[path]:
                    self.__target = Paths.get(
                        Path(paths[path]) / Path(self.__file.name).name)
@@ -66,7 +69,15 @@ class Scripts:
        # Flush file
        self.__file.flush()

    # Folder
    @property
    def folder(self):

        # Result
        return self.__folder

    # Name
    @property
    def name(self):

        # Result