當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。