Exemplo n.º 1
0
        private static ProcessArgumentBuilder GetYarnInstallArguments(YarnInstallSettings settings)
        {
            var args = new ProcessArgumentBuilder();

            settings?.Evaluate(args);
            return(args);
        }
Exemplo n.º 2
0
        /// <summary>
        /// execute 'yarn install' with options
        /// </summary>
        /// <param name="configure">options when running 'yarn install'</param>
        /// <example>
        /// <para>Run 'yarn install'</para>
        /// <code>
        /// <![CDATA[
        /// Task("Yarn-FromPath")
        ///     .Does(() =>
        /// {
        ///     Yarn.FromPath("./dir-with-packagejson").Install();
        /// });
        /// ]]>
        /// </code>
        /// <para>Run 'yarn install'</para>
        /// <code>
        /// <![CDATA[
        /// Task("Yarn-Install")
        ///     .Does(() =>
        /// {
        ///     Yarn.Install();
        /// });
        /// ]]>
        /// </code>
        /// </example>
        public IYarnRunnerCommands Install(Action <YarnInstallSettings> configure = null)
        {
            var settings = new YarnInstallSettings();

            configure?.Invoke(settings);

            var args = GetYarnInstallArguments(settings);

            Run(settings, args);
            return(this);
        }