ソースを参照

Fix errors in Makefile and in some old browsers

It appears Android browsers in 4.x still have issues with
`startsWith()`.
Weiyi Lou 9 年 前
コミット
650612d4e1
2 ファイル変更2 行追加1 行削除
  1. 1 0
      Makefile
  2. 1 1
      js/pgsh.js

+ 1 - 0
Makefile

@@ -9,6 +9,7 @@ help:
 
 dist: ## Create a distribution for live usage
 	# --- Create Folders ---
+	@rm -r dist/*
 	@mkdir -p dist/css dist/js dist/tags
 	# --- Combine CSS ---
 	@for file in $$(cat css/app.css | sed "$(CSS_FILES)"); do \

+ 1 - 1
js/pgsh.js

@@ -271,7 +271,7 @@ function pgsh(ev) {
   // Calculate a destination's path with respect to the current folder.
   var resolveAbsPath = function(dest) {
     var parts = dest.trim().split('/')
-    var absolute = dest.startsWith('/') || self.cwd == '/'
+    var absolute = dest.substring(0, 1) == '/' || self.cwd == '/'
     var path = absolute ? [''] : self.cwd.split('/')
     parts.forEach(function(part) {
       if (part == '..' && path.length > 1) { path.pop() }