Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new directory walking task.
        /// </summary>
        /// <param name="sourcePath">The path of the directory to walk.</param>
        protected DirectoryTaskBase(string sourcePath)
        {
            #region Sanity checks
            if (string.IsNullOrEmpty(sourcePath))
            {
                throw new ArgumentNullException(nameof(sourcePath));
            }
            #endregion

            SourceDirectory = new DirectoryInfo(Path.GetFullPath(sourcePath));
            _sourceIsUnixFS = FlagUtils.IsUnixFS(sourcePath);
        }
Ejemplo n.º 2
0
        public void TestIsUnixFS()
        {
            using var tempDir = new TemporaryDirectory("0install-unit-tests");
            if (UnixUtils.IsUnix)
            {
                FlagUtils.IsUnixFS(tempDir).Should().BeTrue();

                FlagUtils.MarkAsNoUnixFS(tempDir);
                FlagUtils.IsUnixFS(tempDir).Should().BeFalse();
            }
            else
            {
                FlagUtils.IsUnixFS(tempDir).Should().BeFalse();
            }
        }