예제 #1
0
        public LaunchInfo ResolvePath(string path, string args, LaunchInfoSource source)
        {
            var li = new LaunchInfo
            {
                Args       = args,
                Source     = source,
                IsResolved = Split(path, out var dirname, out var filename)
            };

            if (li.IsResolved)
            {
                li.Directory = dirname;
                li.FileName  = filename;
            }

            li.FullPath = path;

            return(li);
        }
 public LaunchInfo ResolvePath(string path, LaunchInfoSource source)
 {
     return(ResolvePath(path, null, null, source));
 }
예제 #3
0
        public virtual LaunchInfo ResolvePath(string path, string workingDir, string args, LaunchInfoSource source)
        {
            int ix = path[0] == '"'
                ? ResolveQuoted(path, workingDir, out var fullCommandPath)
                : ResolveNonQuoted(path, workingDir, out fullCommandPath);

            var info = new LaunchInfo
            {
                Source     = source,
                IsResolved = ix != -1
            };

            if (info.IsResolved)
            {
                info.FullPath  = fullCommandPath;
                info.Directory = Path.GetDirectoryName(fullCommandPath);
                info.FileName  = Path.GetFileName(fullCommandPath);
                var inlinearguments = ix < path.Length - 1 ? path.Substring(ix + 1).Trim() : string.Empty;
                info.Args = JoinArgs(inlinearguments, args);
            }
            else
            {
                info.FullPath = path;
            }

            return(info);
        }
예제 #4
0
        public override LaunchInfo ResolvePath(string path, string workingDir, string args, LaunchInfoSource source)
        {
            var expanded = Environment.ExpandEnvironmentVariables(path);

            return(base.ResolvePath(expanded, workingDir, args, source));
        }