shell-script-exists

Description

Creates an executable file with the provided script content.

Variables

Name Type Default Description

path

string --

The path to the script. Required

script_content

string --

The script content. Required

group

string --

The group of the file.

mode

string 0755

The permissions of the script.

owner

string --

The owner of the file.

parent_dir_mode

string --

The permissions of the parent directory.

system_user

boolean False

Whether the user and group should be of system user/group type.

Code

doc:
  short_help: Creates an executable file with the provided script content.

args:
  _import:
  - file-with-content
  script_content:
    doc:
      short_help: The script content.
    type: string
    required: true
  path:
    doc:
      short_help: The path to the script.
    type: string
    required: true
  mode:
    doc:
      short_help: The permissions of the script.
    type: string
    required: false
    default: '0755'
    cli:
      metavar: MODE
frecklets:
- file-with-content:
    path: '{{:: path ::}}'
    mode: '{{:: mode ::}}'
    owner: '{{:: owner ::}}'
    group: '{{:: group ::}}'
    parent_dir_mode: '{{:: parent_dir_mode ::}}'
    system_user: '{{:: system_user ::}}'
    content: '{{:: script_content ::}}'
frecklecute shell-script-exists --help

Usage: frecklecute shell-script-exists [OPTIONS] PATH

  Creates an executable file with the provided script content.

Options:
  --script-content SCRIPT_CONTENT
                                  The script content.  [required]
  --group GROUP                   The group of the file.
  --mode MODE                     The permissions of the script.
  --owner USER                    The owner of the file.
  --parent-dir-mode MODE          The permissions of the parent directory.
  --system-user / --no-system-user
                                  Whether the user and group should be of
                                  system user/group type.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.shell_script_exists.ShellScriptExists
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class ShellScriptExists(AutoPycklet):
    """Creates an executable file with the provided script content.

       Args:
         group: The group of the file.
         mode: The permissions of the script.
         owner: The owner of the file.
         parent_dir_mode: The permissions of the parent directory.
         path: The path to the script.
         script_content: The script content.
         system_user: Whether the user and group should be of system user/group type.

    """

    FRECKLET_ID = "shell-script-exists"

    group: str = None
    mode: str = None
    owner: str = None
    parent_dir_mode: str = None
    path: str = None
    script_content: str = None
    system_user: bool = None


    def __post_init__(self):
        super(ShellScriptExists, self).__init__(var_names=["group", "mode", "owner", "parent_dir_mode", "path", "script_content", "system_user"])


frecklet_class = ShellScriptExists
# -*- coding: utf-8 -*-


#
# module path: pycklets.shell_script_exists.ShellScriptExists
#


from pyckles import AutoPycklet

class ShellScriptExists(AutoPycklet):
    """Creates an executable file with the provided script content.

       Args:
         group: The group of the file.
         mode: The permissions of the script.
         owner: The owner of the file.
         parent_dir_mode: The permissions of the parent directory.
         path: The path to the script.
         script_content: The script content.
         system_user: Whether the user and group should be of system user/group type.

    """

    FRECKLET_ID = "shell-script-exists"

    def __init__(self, group=None, mode="0755", owner=None, parent_dir_mode=None, path=None, script_content=None, system_user=None):

        super(ShellScriptExists, self).__init__(var_names=["group", "mode", "owner", "parent_dir_mode", "path", "script_content", "system_user"])
        self._group = group
        self._mode = mode
        self._owner = owner
        self._parent_dir_mode = parent_dir_mode
        self._path = path
        self._script_content = script_content
        self._system_user = system_user

    @property
    def group(self):
        return self._group

    @group.setter
    def group(self, group):
        self._group = group

    @property
    def mode(self):
        return self._mode

    @mode.setter
    def mode(self, mode):
        self._mode = mode

    @property
    def owner(self):
        return self._owner

    @owner.setter
    def owner(self, owner):
        self._owner = owner

    @property
    def parent_dir_mode(self):
        return self._parent_dir_mode

    @parent_dir_mode.setter
    def parent_dir_mode(self, parent_dir_mode):
        self._parent_dir_mode = parent_dir_mode

    @property
    def path(self):
        return self._path

    @path.setter
    def path(self, path):
        self._path = path

    @property
    def script_content(self):
        return self._script_content

    @script_content.setter
    def script_content(self, script_content):
        self._script_content = script_content

    @property
    def system_user(self):
        return self._system_user

    @system_user.setter
    def system_user(self, system_user):
        self._system_user = system_user



frecklet_class = ShellScriptExists