当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript shelljs.mv函数代码示例

本文整理汇总了TypeScript中shelljs.mv函数的典型用法代码示例。如果您正苦于以下问题:TypeScript mv函数的具体用法?TypeScript mv怎么用?TypeScript mv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mv函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: rename

 public rename(): void {
   if (this.isInGitRepo()) {
     execSync(`git mv '${this.fromFullpath}' '${this.toFullpath}'`)
   } else {
     mv(this.fromFullpath, this.toFullpath)
   }
 }
开发者ID:elentok,项目名称:dotfiles,代码行数:7,代码来源:renameable.ts

示例2: writeFile

 writeFile(file: FileInfo): void {
   mkdir('-p', dirname(file.path));
   const backPath = file.path + '.bak';
   if (existsSync(file.path) && !existsSync(backPath)) {
     mv(file.path, backPath);
   }
   writeFileSync(file.path, file.contents, 'utf8');
 }
开发者ID:felixfbecker,项目名称:angular,代码行数:8,代码来源:transformer.ts

示例3: mv

 renameFiles.forEach(function(files) {
   // Files[0] is the current filename
   // Files[1] is the new name
   let newFilename = files[1].replace(/--libraryname--/g, libraryName)
   mv(
     path.resolve(__dirname, "..", files[0]),
     path.resolve(__dirname, "..", newFilename)
   )
   console.log(colors.cyan(files[0] + " => " + newFilename))
 })
开发者ID:robertrbairdii,项目名称:typescript-library-starter,代码行数:10,代码来源:init.ts

示例4: writeFileAndBackup

 protected writeFileAndBackup(file: FileInfo): void {
   mkdir('-p', dirname(file.path));
   const backPath = file.path + '.__ivy_ngcc_bak';
   if (existsSync(backPath)) {
     throw new Error(
         `Tried to overwrite ${backPath} with an ngcc back up file, which is disallowed.`);
   }
   if (existsSync(file.path)) {
     mv(file.path, backPath);
   }
   writeFileSync(file.path, file.contents, 'utf8');
 }
开发者ID:Cammisuli,项目名称:angular,代码行数:12,代码来源:in_place_file_writer.ts

示例5: constructor

	constructor($errors: IErrors,
		$staticConfig: IStaticConfig,
		$hostInfo: IHostInfo) {
		super({
			ipa: { type: OptionType.String },
			frameworkPath: { type: OptionType.String },
			frameworkName: { type: OptionType.String },
			framework: { type: OptionType.String },
			frameworkVersion: { type: OptionType.String },
			copyFrom: { type: OptionType.String },
			linkTo: { type: OptionType.String  },
			symlink: { type: OptionType.Boolean },
			forDevice: { type: OptionType.Boolean },
			client: { type: OptionType.Boolean, default: true},
			production: { type: OptionType.Boolean },
			debugTransport: {type: OptionType.Boolean},
			keyStorePath: { type: OptionType.String },
			keyStorePassword: { type: OptionType.String,},
			keyStoreAlias: { type: OptionType.String },
			keyStoreAliasPassword: { type: OptionType.String },
			ignoreScripts: {type: OptionType.Boolean },
			tnsModulesVersion: { type: OptionType.String },
			compileSdk: {type: OptionType.Number },
			port: { type: OptionType.Number },
			copyTo: { type: OptionType.String },
			baseConfig: { type: OptionType.String },
			platformTemplate: { type: OptionType.String },
			ng: {type: OptionType.Boolean },
			tsc: {type: OptionType.Boolean },
			bundle: {type: OptionType.Boolean },
			all: {type: OptionType.Boolean },
			teamId: { type: OptionType.String }
		},
		path.join($hostInfo.isWindows ? process.env.AppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
			$errors, $staticConfig);

		// On Windows we moved settings from LocalAppData to AppData. Move the existing file to keep the existing settings
		// I guess we can remove this code after some grace period, say after 1.7 is out
		if ($hostInfo.isWindows) {
			try {
				let shelljs = require("shelljs"),
					oldSettings = path.join(process.env.LocalAppData, ".nativescript-cli", "user-settings.json"),
					newSettings = path.join(process.env.AppData, ".nativescript-cli", "user-settings.json");
				if (shelljs.test("-e", oldSettings) && !shelljs.test("-e", newSettings)) {
					shelljs.mkdir(path.join(process.env.AppData, ".nativescript-cli"));
					shelljs.mv(oldSettings, newSettings);
				}
			} catch (err) {
				// ignore the error - it is too early to use $logger here
			}
		}
	}
开发者ID:JELaVallee,项目名称:nativescript-cli,代码行数:52,代码来源:options.ts

示例6: copyFile

 function copyFile(file: string, baseDir: string, relative = '.') {
   const dir = path.join(baseDir, relative);
   shx.mkdir('-p', dir);
   shx.cp(file, dir);
   // Double-underscore is used to escape forward slash in FESM filenames.
   // See ng_package.bzl:
   //   fesm_output_filename = entry_point.replace("/", "__")
   // We need to unescape these.
   if (file.indexOf('__') >= 0) {
     const outputPath = path.join(dir, ...path.basename(file).split('__'));
     shx.mkdir('-p', path.dirname(outputPath));
     shx.mv(path.join(dir, path.basename(file)), outputPath);
   }
 }
开发者ID:IdeaBlade,项目名称:angular,代码行数:14,代码来源:packager.ts

示例7: writeFesm

 function writeFesm(file: string, baseDir: string) {
   const parts = path.basename(file).split('__');
   const entryPointName = parts.join('/').replace(/\..*/, '');
   if (primaryEntryPoint === null || primaryEntryPoint === entryPointName) {
     primaryEntryPoint = entryPointName;
   } else {
     secondaryEntryPoints.add(entryPointName);
   }
   const filename = parts.splice(-1)[0];
   const dir = path.join(baseDir, ...parts);
   shx.mkdir('-p', dir);
   shx.cp(file, dir);
   shx.mv(path.join(dir, path.basename(file)), path.join(dir, filename));
 }
开发者ID:robwormald,项目名称:angular,代码行数:14,代码来源:packager.ts

示例8: copyFile

  function copyFile(file: string, baseDir: string, relative = '.') {
    const dir = path.join(baseDir, relative);
    shx.mkdir('-p', dir);
    shx.cp(file, dir);
    // Double-underscore is used to escape forward slash in FESM filenames.
    // See ng_package.bzl:
    //   fesm_output_filename = entry_point.replace("/", "__")
    // We need to unescape these.
    if (file.indexOf('__') >= 0) {
      const outputPath = path.join(dir, ...path.basename(file).split('__'));
      shx.mkdir('-p', path.dirname(outputPath));
      shx.mv(path.join(dir, path.basename(file)), outputPath);

      // if we are renaming the .js file, we'll also need to update the sourceMappingURL in the file
      if (file.endsWith('.js')) {
        shx.chmod('+w', outputPath);
        shx.sed('-i', `${path.basename(file)}.map`, `${path.basename(outputPath)}.map`, outputPath);
      }
    }
  }
开发者ID:Cammisuli,项目名称:angular,代码行数:20,代码来源:packager.ts

示例9: then

then(() => shell.mv(otherVisPrDir, targetVisPrDir)).
开发者ID:cooperka,项目名称:angular,代码行数:1,代码来源:build-creator.ts

示例10: then

then(() => shell.mv(oldPrDir, newPrDir)).
开发者ID:noamkfir,项目名称:angular,代码行数:1,代码来源:build-creator.ts

示例11: moveFile

 moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void { mv(from, to); }
开发者ID:marclaval,项目名称:angular,代码行数:1,代码来源:node_js_file_system.ts


注:本文中的shelljs.mv函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。