Move static files from source/ to public/
328407
protected function moveStatic() {
		
		// set-up the dispatcher
		$dispatcherInstance = Dispatcher::getInstance();
		
		// note the start of the operation
		$dispatcherInstance->dispatch("generator.moveStaticStart");
		
		// common values
		$publicDir = Config::getOption("publicDir");
		$sourceDir = Config::getOption("sourceDir");
		$ignoreExt = Config::getOption("ie");
		$ignoreDir = Config::getOption("id");
		
		// iterate over all of the other files in the source directory
		$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourceDir), \RecursiveIteratorIterator::SELF_FIRST);
		
		// make sure dots are skipped
		$objects->setFlags(\FilesystemIterator::SKIP_DOTS);
		
		foreach($objects as $name => $object) {
			
			// clean-up the file name and make sure it's not one of the pattern lab files or to be ignored
			$fileName = str_replace($sourceDir.DIRECTORY_SEPARATOR,"",$name);
			
			if (($fileName[0] != "_") && (!in_array($object->getExtension(),$ignoreExt)) && (!in_array($object->getFilename(),$ignoreDir))) {
				
				// catch directories that have the ignored dir in their path
				$ignored = FileUtil::ignoreDir($fileName);
				
				// check to see if it's a new directory
				if (!$ignored && $object->isDir() && !is_dir($publicDir."/".$fileName)) {
					mkdir($publicDir."/".$fileName);
				}
				
				// check to see if it's a new file or a file that has changed
				if (!$ignored && $object->isFile() && (!file_exists($publicDir."/".$fileName))) {
					FileUtil::moveStaticFile($fileName);
				}
				
			}
			
		}
		
		// note the end of the operation
		$dispatcherInstance->dispatch("generator.moveStaticEnd");
		
	}
124892
static function moveFile($source, $target, $overwrite = true)
    {
        if (!file_exists($source)) return false;
        if (file_exists($target) && $overwrite == false) return false;
        elseif (file_exists($target) && $overwrite == true) {
            if (!unlink($target)) return false;
        }
        $targetDir = dirname($target);
        if (!self::createDirectory($targetDir)) return false;
        return rename($source, $target);
    }
81503
def remove(ctx, client, sources):
    """"""
    from renku.api._git import _expand_directories

    def fmt_path(path):
        """Format path as relative to the client path."""
        return str(Path(path).absolute().relative_to(client.path))

    files = {
        fmt_path(source): fmt_path(file_or_dir)
        for file_or_dir in sources
        for source in _expand_directories((file_or_dir, ))
    }

    # 1. Update dataset metadata files.
    with progressbar(
        client.datasets.values(),
        item_show_func=lambda item: str(item.short_id) if item else '',
        label='Updating dataset metadata',
        width=0,
    ) as bar:
        for dataset in bar:
            remove = []
            for key, file_ in dataset.files.items():
                filepath = fmt_path(file_.full_path)
                if filepath in files:
                    remove.append(key)

            if remove:
                for key in remove:
                    dataset.unlink_file(key)

                dataset.to_yaml()

    # 2. Manage .gitattributes for external storage.
    tracked = tuple(
        path for path, attr in client.find_attr(*files).items()
        if attr.get('filter') == 'lfs'
    )
    client.untrack_paths_from_storage(*tracked)
    existing = client.find_attr(*tracked)
    if existing:
        click.echo(WARNING + 'There are custom .gitattributes.\n')
        if click.confirm(
            'Do you want to edit ".gitattributes" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitattributes'))

    # Finally remove the files.
    final_sources = list(set(files.values()))
    if final_sources:
        run(['git', 'rm', '-rf'] + final_sources, check=True)
593093
def _copy_static_assets(self, output_dir):
        
        base_directory = 'assets/{}'.format(self._report_name)
        for asset in resource_listdir(self._package_name, base_directory):
            filename = resource_filename(
                self._package_name, '{}/{}'.format(base_directory, asset))
            shutil.copy2(filename, output_dir)
1155491
function copyReadmeFiles() {

    const resolvedSrcReadmePaths = path.resolve(rootDir, srcReadmePaths);

    dryRun ? console.log(`In ${destDir}, this script would...`) : console.log(`In ${destDir}...`);

    fs.readdir('packages', (err, files) => {
        totalDocsCount = files.length;
    });

    createDirectory(destDir);
    glob(resolvedSrcReadmePaths, {realpath:true}, function(error, srcFiles) {
        
        srcFiles.forEach((srcReadmePath) => {    
            createDestReadme(srcReadmePath);
            const srcDirPath = path.dirname(srcReadmePath);
            const lastSrcDir = srcDirPath.split(path.sep).pop();
            sidebarEntries.push(`en/packages/${lastSrcDir}/index`);
        });

        console.log(chalk.green(`${updatedDocsCount} of ${totalDocsCount} package readme.md files updated`));
        updateSidebar();
       
    });

}
359441
def collect_static_files(src_map, dst):
    
    for rel_src, abs_src in src_map.iteritems():
        abs_dst = os.path.join(dst, rel_src)
        copy_file(abs_src, abs_dst)
1214153
def clean_source_files(self):
        """"""

        self.build_source_files.file(File.BSFILE.SOURCESCHEMA).remove()
        self.build_source_files.file(File.BSFILE.SCHEMA).remove()
        self.commit()
916896
def move(src, dest, user=None):
    
    src_host, src_port, src_path = path.split(src, user)
    dest_host, dest_port, dest_path = path.split(dest, user)
    src_fs = hdfs(src_host, src_port, user)
    dest_fs = hdfs(dest_host, dest_port, user)
    try:
        retval = src_fs.move(src_path, dest_fs, dest_path)
        return retval
    finally:
        src_fs.close()
        dest_fs.close()
283165
def construct_asset_path(self, asset_path, css_path, output_filename, variant=None):
        """"""
        public_path = self.absolute_path(asset_path, os.path.dirname(css_path).replace('\\', '/'))
        if self.embeddable(public_path, variant):
            return "__EMBED__%s" % public_path
        if not posixpath.isabs(asset_path):
            asset_path = self.relative_path(public_path, output_filename)
        return asset_path
663155
def _get_files_to_lint(self, external_directories):
        """"""
        all_f = []

        for external_dir in external_directories:
            all_f.extend(_all_files_matching_ext(external_dir, "py"))

        packages = self.distribution.packages or list()
        for package in packages:
            all_f.extend(_all_files_matching_ext(package, "py"))

        py_modules = self.distribution.py_modules or list()
        for filename in py_modules:
            all_f.append(os.path.realpath(filename + ".py"))

        all_f.append(os.path.join(os.getcwd(), "setup.py"))

        # Remove duplicates which may exist due to symlinks or repeated
        # packages found by /setup.py
        all_f = list(set([os.path.realpath(f) for f in all_f]))

        exclusions = [
            "*.egg/*",
            "*.eggs/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
186977
def post_public(self, path, data, is_json=True):
        ''''''
        return self._post(path, data, is_json)
1240687
function copyAssetsLess() {
  return gulp.src(['./src/assets/stylesheets/*.less'])
    .pipe(replace(/\.\.\/.\.\/.\.\//g, function () {
      return '../../../../';
    }))
    .pipe(replace(/@import '\.\.\/\.\.\/.*\//g, function () {
      return '@import \'';
    }))
    .pipe(rename({dirname: ''}))
    .pipe(gulp.dest(libraryDist + '/dist/less'));
}
1043899
def static!
      return if (public_dir = settings.public_folder).nil?
      public_dir = File.expand_path(public_dir)

      path = File.expand_path(public_dir + unescape(request.path_info))
      return unless path.start_with?(public_dir) and File.file?(path)

      env['sinatra.static_file'] = path
      cache_control(*settings.static_cache_control) if settings.static_cache_control?
      send_file path, :disposition => nil
    end
244802
public function loadPublic()
    {
        $directory = base_path("public/src");

        if (!File::exists($directory)) {
            File::makeDirectory($directory, 0775, true);
        }

        $basic = $directory."/".$this->name;

        $package = $this->base_path."/Resources/public";

        $this->createLink($package, $basic);
    }
657056
public static void moveToTrash(FileSystem fs, Path path) throws IOException {
    Trash trash = new Trash(fs, new Configuration());
    trash.moveToTrash(path);
  }
515605
function servePublicFile(file, type, maxAge) {
    const publicFileMiddleware = createPublicFileMiddleware(file, type, maxAge);

    return function servePublicFile(req, res, next) {
        if (req.path === '/' + file) {
            return publicFileMiddleware(req, res, next);
        } else {
            return next();
        }
    };
}
180433
def interlink_static_files(generator):
    ''''''
    if generator.settings['STATIC_PATHS'] != []:
        return                               # customized STATIC_PATHS
    try: # minimize attr lookup
        static_content = generator.context['static_content']
    except KeyError:
        static_content = generator.context['filenames']
    relpath = relpath_to_site(generator.settings['DEFAULT_LANG'], _MAIN_LANG)
    for staticfile in _MAIN_STATIC_FILES:
        if staticfile.get_relative_source_path() not in static_content:
            staticfile = copy(staticfile) # prevent override in main site
            staticfile.override_url = posixpath.join(relpath, staticfile.url)
            try:
                generator.add_source_path(staticfile, static=True)
            except TypeError:
                generator.add_source_path(staticfile)