From 5087fdbc7490057f93bcbcce378bd7b8e0391172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 2 May 2018 17:56:10 +0800 Subject: [PATCH] Use https --- bash/bashrc/rbashrc | 6 +++--- python/reg-rename.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 python/reg-rename.py diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index 0acc496..2329f02 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -146,7 +146,7 @@ function rbash_upgrade { echo "Updating $__SCRIPT" __uuid TMPID TMPFILE=/tmp/$TMPID - __download "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/rbashrc;hb=HEAD" > $TMPFILE + __download "https://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/rbashrc;hb=HEAD" > $TMPFILE if [ -z "$1" ]; then MC_NAME="" @@ -179,7 +179,7 @@ function rbash_upgrade { function rbash_run { echo "Getting: $1" - __cacheDownload "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=$1;hb=HEAD" + __cacheDownload "https://git.astropenguin.net/?p=utils.git;a=blob_plain;f=$1;hb=HEAD" shift __uuid TMPID TMPFILE=/tmp/$TMPID @@ -203,7 +203,7 @@ function __ns { fi echo " $1" - __cacheDownload "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/$FPATH;hb=HEAD" + __cacheDownload "https://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/$FPATH;hb=HEAD" shift __uuid TMPID TMPFILE=/tmp/$TMPID diff --git a/python/reg-rename.py b/python/reg-rename.py old mode 100644 new mode 100755 index a5d609d..7c05b4e --- a/python/reg-rename.py +++ b/python/reg-rename.py @@ -74,7 +74,9 @@ class RAction: if test: return "R \"%s\" will be renamed to \"%s\"" % ( _from, _to ) else: - os.rename( os.path.join( root, _from ), os.path.join( root, _to ) ) + target_loc = os.path.join( root, _to ) + os.makedirs( os.path.dirname( target_loc ), exist_ok = True ) + os.rename( os.path.join( root, _from ), target_loc ) return "R \"%s\" -> \"%s\"" % ( _from, _to ) class RegReplace: