is_directory
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSIsDirectoryCommand anyenv.os_commands.is_directory macOS is directory command implementation. |
||
| UnixIsDirectoryCommand anyenv.os_commands.is_directory Unix/Linux is directory command implementation. |
||
| WindowsIsDirectoryCommand anyenv.os_commands.is_directory Windows is directory command implementation. |
🛈 DocStrings¶
Is directory command implementations for different operating systems.
MacOSIsDirectoryCommand
¶
Bases: IsDirectoryCommand
macOS is directory command implementation.
Source code in src/anyenv/os_commands/is_directory.py
create_command
¶
Generate test -d command (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a directory |
required |
Returns:
| Type | Description |
|---|---|
str
|
The test command string |
parse_command
¶
Parse test -d result based on exit code (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output (ignored) |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a directory, False otherwise |
Source code in src/anyenv/os_commands/is_directory.py
UnixIsDirectoryCommand
¶
Bases: IsDirectoryCommand
Unix/Linux is directory command implementation.
Source code in src/anyenv/os_commands/is_directory.py
create_command
¶
Generate Unix test -d command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a directory |
required |
Returns:
| Type | Description |
|---|---|
str
|
The test command string |
parse_command
¶
Parse Unix test -d result based on exit code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output (ignored) |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a directory, False otherwise |
Source code in src/anyenv/os_commands/is_directory.py
WindowsIsDirectoryCommand
¶
Bases: IsDirectoryCommand
Windows is directory command implementation.
Source code in src/anyenv/os_commands/is_directory.py
create_command
¶
Generate PowerShell directory test command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a directory |
required |
Returns:
| Type | Description |
|---|---|
str
|
The PowerShell command string |
Source code in src/anyenv/os_commands/is_directory.py
parse_command
¶
Parse PowerShell directory test result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw PowerShell command output |
required |
exit_code
|
int
|
Command exit code (ignored) |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a directory, False otherwise |