Exemplo n.º 1
0
        protected override Result _execute(ImmutableArray <EvaluatedParameter> parameters, FunctionScope function_scope)
        {
            if (parameters.Length > 3)
            {
                throw new WrongParameterCountException(this, expected: 1, actual: parameters.Length);
            }

            FinalExpression param_1 = parameters [0].EvaluatedValue;

            var possible_paths = IncludePathHelper.ResolveToFull(param_1.GetStringValue(), function_scope);

            Log.Debug($"create directory: {possible_paths.Select (p => p.Original).Join (", ")}");

            return(new Result(new BoolExpression(true)));
        }
Exemplo n.º 2
0
        protected override Result _execute(ImmutableArray <EvaluatedParameter> parameters, FunctionScope function_scope)
        {
            if (parameters.Length != 1)
            {
                throw new WrongParameterCountException(this, expected: 1, actual: parameters.Length);
            }

            FinalExpression param_1 = parameters [0].EvaluatedValue;

            var possible_paths = IncludePathHelper.ResolveToFull(param_1.GetStringValue(), function_scope);

            Log.Debug($"check if path is a regular file: {possible_paths.Select (p => p.Original).Join (", ")}");
            bool does_exist = possible_paths.Any(p => System.IO.File.Exists(p.Original));

            return(new Result(new BoolExpression(does_exist)));
        }