     )
   )
 
+(defun get-string-from-file (filePath)
+  "Return filePath's file content."
+  (with-temp-buffer
+    (insert-file-contents filePath)
+    (buffer-string)))
+
 
 (add-hook 'after-save-hook 'rebar-compile-source)
+
+
 
 
 

                                            buffer-name
                                            ))
                (shell-command compile-cmd "*Messages")
                ;;(message compile-cmd)
                )
            )
          )

                             "galaxy-empire-hub-2"
                             "gl_999"
                             "6"
                             "5"
                             ;;"galaxy_server"

                             "player_node"
                             "agent_node"
                             "master_node"
                             "pvp_node"
                             "battle"
                             "chat_server"
                             "cluster_server"
                             "conf_parser"
                             "controller"
                             "model"
                             "mongodb_server"
                             "server_manager"
                             "utility"
                             ))


(setq beam_sync_list "/Users/zhuoyikang/Source/gl2/galaxy_server/")
(setq beamHash (make-hash-table :test 'equal))


;; 循环遍历copy
(defun beam_hash_cp_key(key)
  (let ((value (gethash key beamHash)))
    (while (car value)
      (let ((v1 (car value)))
        (progn ()
               (setq compile-cmd  (concat  "cp " key " " v1))
               (shell-command compile-cmd "*Messages")
               (message compile-cmd "*Messages")
               )
        )
      (setq value (cdr value))
      )
    )
  )

(defun read-lines (filePath)
  "Return a list of lines of a file at filePath."
  (with-temp-buffer
    (insert-file-contents filePath)
    (split-string (buffer-string) "\n" t)))


(defun load_beam_hash ()
  (let ((list (read-lines (concat beam_sync_list "scripts/.sync.sh")))
        )
    (while (car list)
      ;;(message (car list) "*Messages")
      (let ((scp (split-string  (car list)))
            )
        (if (> (length (list scp)) 0)
            (progn
              ;;(message (concat beam_sync_list (nth 1 scp)) "*Messages")
              (puthash (concat beam_sync_list (nth 1 scp))
                       (push (concat beam_sync_list (nth 2 scp)) (gethash (concat beam_sync_list (nth 1 scp)) beamHash))
                       beamHash)
              )
          )
        )
      (setq list (cdr list)))
    )
  )

(and (clrhash beamHash) (load_beam_hash))

;;(replace-regexp-in-string ".erl" ".beam" (buffer-name))

(buffer-file-name (current-buffer))

(defun rebar-compile-source ()
  "编译当前缓冲区的文件，在文件保存后执行."
