Sha256: 5c8caba7add63efd0c89b163c00d598c1848636e7db22944ac52e11265627f11

Contents?: true

Size: 499 Bytes

Versions: 3

Compression:

Stored size: 499 Bytes

Contents

module GGSM
  module Token
    def check_token
      ggsm_path = '.git/ggsm'
      unless File.exist?(ggsm_path)
        Dir.mkdir(ggsm_path)
      end

      config_path = "#{ggsm_path}/TOKEN"

      if !File.exist?(config_path) || '' == IO.read(config_path).strip || IO.readlines(config_path)[0].strip == ''
        file = File.new(config_path, 'w')
        file << "\n# 请输入正确的GitLab private-token"
        file.close
        return false
      end

      return true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ggsm-1.8.5 lib/ggsm/mr/token.rb
ggsm-1.8.4 lib/ggsm/mr/token.rb
ggsm-1.8.3 lib/ggsm/mr/token.rb