Skip to content

Commit

Permalink
refactor: changed names of several parameters
Browse files Browse the repository at this point in the history
FossilOrigin-Name: c25ac6a899e6771b48f91ba5d9d735ff72ed6361cc6e51549f90b76bce6d3a9e
  • Loading branch information
thindil committed Jun 19, 2024
1 parent 7541c5d commit ad75981
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/variables.nim
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ proc to(dbVal: DbValue, T: typedesc[VariableValType]): T {.raises: [], tags: [
except ValueError:
text

proc buildQuery(directory: Path; fields: string = "";
where: string = ""): string {.sideEffect, raises: [], tags: [ReadDbEffect],
proc buildQuery(directory: Path; fields: DbString = "";
where: DbString = ""): string {.sideEffect, raises: [], tags: [
ReadDbEffect],
contractual.} =
## Build database query for get environment variables for the selected
## directory and its parents
Expand Down Expand Up @@ -120,10 +121,10 @@ proc buildQuery(directory: Path; fields: string = "";

result.add(y = " ORDER BY id ASC")

proc newVariable(name: string = ""; path: Path = "".Path;
recursive: bool = false; value: string = "";
description: string = ""): Variable {.raises: [],
tags: [], contractual.} =
proc newVariable(name: VariableName = ""; path: Path = "".Path;
recursive: bool = false; value: VariableValue = "";
description: OutputMessage = ""): Variable {.raises: [], tags: [],
contractual.} =
## Create a new data structure for the shell's environment variable.
##
## * name - the name of the variable. Must be unique
Expand Down Expand Up @@ -194,7 +195,8 @@ proc setVariables*(newDirectory: Path; db;
variableEnd.inc
if variableEnd > value.len:
variableEnd = value.len
let variableName: VariableName = value[variableIndex + 1..variableEnd - 1]
let variableName: VariableName = value[variableIndex +
1..variableEnd - 1]
value[variableIndex..variableEnd - 1] = getEnv(key = variableName)
variableIndex = value.find(sub = '$', start = variableEnd)
putEnv(key = variable.name, val = value)
Expand Down

0 comments on commit ad75981

Please sign in to comment.