本文整理汇总了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)
}
}
示例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');
}
示例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))
})
示例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');
}
示例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
}
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
}
示例9: then
then(() => shell.mv(otherVisPrDir, targetVisPrDir)).
示例10: then
then(() => shell.mv(oldPrDir, newPrDir)).
示例11: moveFile
moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void { mv(from, to); }