Skip to content

Commit

Permalink
⚡ Move enums and types to own dir
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed May 20, 2019
1 parent 3d69a65 commit c4aa39e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/enums/commands.ts → src/enums/commands/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const enum CommandAliasses {
const enum Default {
RUNNING_CONTAINER_NAMES = "docker ps |awk '{print $NF}' |tail -n +2",
RUNNING_CONTAINER_IDS = "docker ps |awk '{print $1}' |tail -n +2",
ALL_CONTAINER_NAMES = "docker ps -a |awk '{print $NF}' |tail -n +2",
Expand All @@ -9,4 +9,4 @@ const enum CommandAliasses {
IMAGE_IDS = "docker images |awk '{print $3}' |tail -n +2",
}

export default CommandAliasses;
export default Default;
8 changes: 8 additions & 0 deletions src/enums/commands/id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import CommandAliasses from './default';

export const IdCommands = {
ps: CommandAliasses.RUNNING_CONTAINER_IDS,
psa: CommandAliasses.ALL_CONTAINER_IDS,
images: CommandAliasses.IMAGE_IDS,
psaStopped: CommandAliasses.ALL_STOPPED_CONTAINER_IDS,
};
8 changes: 8 additions & 0 deletions src/enums/commands/name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import CommandAliasses from './default';

export const NameCommands = {
ps: CommandAliasses.RUNNING_CONTAINER_NAMES,
psa: CommandAliasses.ALL_CONTAINER_NAMES,
images: CommandAliasses.IMAGE_NAMES,
psaStopped: CommandAliasses.ALL_STOPPED_CONTAINER_NAMES,
};
2 changes: 2 additions & 0 deletions src/enums/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './commands/id';
export * from './commands/name';
3 changes: 3 additions & 0 deletions src/types/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Type = 'psa' | 'ps' | 'psaStopped' | 'images';

export default Type;

0 comments on commit c4aa39e

Please sign in to comment.